Skip to content

Commit b362698

Browse files
authored
typos (#926)
1 parent 44ac4b9 commit b362698

File tree

8 files changed

+41
-41
lines changed

8 files changed

+41
-41
lines changed

aderyn/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub struct CommandLineArgs {
6363
#[arg(long, name = "stdout", hide = true)]
6464
stdout: bool,
6565

66-
/// Skip couting number of lines of code.
66+
/// Skip counting number of lines of code.
6767
#[arg(long, hide = true)]
6868
skip_cloc: bool,
6969

aderyn_core/src/context/flow/mod.rs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub mod voids;
1010

1111
use crate::{
1212
ast::*,
13-
context::flow::utils::{discover_jump_sources, Callibration},
13+
context::flow::utils::{discover_jump_sources, Calibration},
1414
};
1515

1616
pub use kind::CfgNodeKind;
@@ -291,7 +291,7 @@ impl Cfg {
291291
self.add_flow_edge(end_id, *succ);
292292
}
293293

294-
// Step 8: Remove existing connections with redution_candidate
294+
// Step 8: Remove existing connections with reduction_candidate
295295
self.remove_raw_edges_involving(reduction_candidate);
296296
}
297297

@@ -312,7 +312,7 @@ impl Cfg {
312312
///
313313
/// * end_node - Return statements flow to here. It also serves as a fallback for break and
314314
/// continue statements if parent loop is not found
315-
pub fn callibrate_jump_statements_in_body(
315+
pub fn calibrate_jump_statements_in_body(
316316
&mut self,
317317
start_node: CfgNodeId,
318318
end_node: CfgNodeId,
@@ -334,28 +334,27 @@ impl Cfg {
334334
&mut return_statements,
335335
);
336336

337-
// Proposed Callibrations
338-
let mut proposed_callibrations = vec![];
337+
// Proposed Calibrations
338+
let mut proposed_calibrations = vec![];
339339

340340
for continue_statement in continue_statements {
341341
let mut visited = Default::default();
342342
let dest = find_jump_dest(self, continue_statement, &mut visited).unwrap_or_default();
343-
proposed_callibrations
344-
.push(Callibration::ContinueShouldFlowTo(continue_statement, dest));
343+
proposed_calibrations.push(Calibration::ContinueShouldFlowTo(continue_statement, dest));
345344
}
346345

347346
for break_statement in break_statements {
348347
let mut visited = Default::default();
349348
let dest = find_jump_dest(self, break_statement, &mut visited).unwrap_or_default();
350-
proposed_callibrations.push(Callibration::BreakShouldFlowTo(break_statement, dest));
349+
proposed_calibrations.push(Calibration::BreakShouldFlowTo(break_statement, dest));
351350
}
352351

353352
for return_statement in return_statements {
354-
proposed_callibrations.push(Callibration::ReturnShouldFlowToEndNode(return_statement));
353+
proposed_calibrations.push(Calibration::ReturnShouldFlowToEndNode(return_statement));
355354
}
356355

357356
// End node now comes into play
358-
self.callibrate(proposed_callibrations, end_node);
357+
self.calibrate(proposed_calibrations, end_node);
359358
}
360359

361360
pub fn find_ending_counter_part(&self, start_node_id: CfgNodeId) -> CfgNodeId {
@@ -398,7 +397,7 @@ impl Cfg {
398397
// Add the actual function body
399398
let block = cfg.add_block_node(function_body_block);
400399

401-
// Connect tht flow edges
400+
// Connect the flow edges
402401
cfg.add_flow_edge(start, block);
403402
cfg.add_flow_edge(block, end);
404403

@@ -407,8 +406,8 @@ impl Cfg {
407406
cfg.reduce(context, reduction_candidate);
408407
}
409408

410-
// Callibration step (Standard thing to do after you reduce your CFG)
411-
cfg.callibrate_jump_statements_in_body(start, end);
409+
// Calibration step (Standard thing to do after you reduce your CFG)
410+
cfg.calibrate_jump_statements_in_body(start, end);
412411

413412
// Return the CFG
414413
Some((cfg, start, end))
@@ -433,7 +432,7 @@ impl Cfg {
433432
// Add the actual function body
434433
let block = cfg.add_block_node(modifier_body_block);
435434

436-
// Connect tht flow edges
435+
// Connect the flow edges
437436
cfg.add_flow_edge(start, block);
438437
cfg.add_flow_edge(block, end);
439438

@@ -442,8 +441,8 @@ impl Cfg {
442441
cfg.reduce(context, reduction_candidate);
443442
}
444443

445-
// Callibration step (Standard thing to do after you reduce your CFG)
446-
cfg.callibrate_jump_statements_in_body(start, end);
444+
// Calibration step (Standard thing to do after you reduce your CFG)
445+
cfg.calibrate_jump_statements_in_body(start, end);
447446

448447
// Return the CFG
449448
Some((cfg, start, end))

aderyn_core/src/context/flow/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ mod control_flow_tests {
2727
}
2828
}
2929

30-
// Accept block (Pre callibration checks)
30+
// Accept block (Pre calibration checks)
3131
#[test]
3232

3333
fn simple_program_function1() {
@@ -234,7 +234,7 @@ mod control_flow_tests {
234234
assert_eq!(cfg.nodes.len(), 9);
235235
}
236236

237-
// Accept-Function-Body (Post callibration checks)
237+
// Accept-Function-Body (Post calibration checks)
238238

239239
#[test]
240240

aderyn_core/src/context/flow/utils.rs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -141,45 +141,43 @@ impl Default for JumpDestination {
141141
}
142142
}
143143

144-
pub enum Callibration {
144+
pub enum Calibration {
145145
ContinueShouldFlowTo(CfgNodeId, JumpDestination),
146146
BreakShouldFlowTo(CfgNodeId, JumpDestination),
147147
ReturnShouldFlowToEndNode(CfgNodeId),
148148
}
149149

150150
impl Cfg {
151-
pub(crate) fn callibrate(
151+
pub(crate) fn calibrate(
152152
&mut self,
153-
proposed_callibrations: Vec<Callibration>,
153+
proposed_calibrations: Vec<Calibration>,
154154
end_node: CfgNodeId,
155155
) {
156-
for proposed_callibration in proposed_callibrations {
157-
let (target, callibrated_dest) = match proposed_callibration {
158-
Callibration::ContinueShouldFlowTo(c, JumpDestination::For(for_node)) => {
156+
for proposed_calibration in proposed_calibrations {
157+
let (target, calibrated_dest) = match proposed_calibration {
158+
Calibration::ContinueShouldFlowTo(c, JumpDestination::For(for_node)) => {
159159
(c, self.find_loop_expression_node(for_node))
160160
}
161-
Callibration::ContinueShouldFlowTo(c, JumpDestination::While(while_node)) => {
161+
Calibration::ContinueShouldFlowTo(c, JumpDestination::While(while_node)) => {
162162
(c, self.find_condition_node(while_node))
163163
}
164-
Callibration::ContinueShouldFlowTo(c, JumpDestination::DoWhile(do_while_node)) => {
164+
Calibration::ContinueShouldFlowTo(c, JumpDestination::DoWhile(do_while_node)) => {
165165
(c, self.find_condition_node(do_while_node))
166166
}
167-
Callibration::ContinueShouldFlowTo(c, JumpDestination::DefaultSite) => {
168-
(c, end_node)
169-
}
170-
Callibration::BreakShouldFlowTo(b, JumpDestination::For(for_node)) => {
167+
Calibration::ContinueShouldFlowTo(c, JumpDestination::DefaultSite) => (c, end_node),
168+
Calibration::BreakShouldFlowTo(b, JumpDestination::For(for_node)) => {
171169
(b, self.find_ending_counter_part(for_node))
172170
}
173-
Callibration::BreakShouldFlowTo(b, JumpDestination::While(while_node)) => {
171+
Calibration::BreakShouldFlowTo(b, JumpDestination::While(while_node)) => {
174172
(b, self.find_ending_counter_part(while_node))
175173
}
176-
Callibration::BreakShouldFlowTo(b, JumpDestination::DoWhile(do_while_node)) => {
174+
Calibration::BreakShouldFlowTo(b, JumpDestination::DoWhile(do_while_node)) => {
177175
(b, self.find_ending_counter_part(do_while_node))
178176
}
179-
Callibration::BreakShouldFlowTo(b, JumpDestination::DefaultSite) => (b, end_node),
180-
Callibration::ReturnShouldFlowToEndNode(r) => (r, end_node),
177+
Calibration::BreakShouldFlowTo(b, JumpDestination::DefaultSite) => (b, end_node),
178+
Calibration::ReturnShouldFlowToEndNode(r) => (r, end_node),
181179
};
182-
self.reset_raw_successors(target, callibrated_dest);
180+
self.reset_raw_successors(target, calibrated_dest);
183181
}
184182
}
185183
}

aderyn_core/src/detect/low/incorrect_modifier.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ fn all_paths_have_revert_or_placeholder(
174174

175175
let final_answer = answers.entry(start).or_default();
176176

177-
// '0' becauase we start from having nothing
177+
// '0' because we start from having nothing
178178
final_answer[0]
179179
}
180180

aderyn_core/src/detect/test_utils/load_source_unit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ fn absorb_ast_content_into_context(
129129
// Set the source
130130
source_unit.source = Some(content.content.to_string());
131131

132-
// Adjust the asbolute filepath to be relative
132+
// Adjust the absolute filepath to be relative
133133
let filepath = source_unit.absolute_path.as_ref().unwrap();
134134
source_unit.absolute_path = Some(filepath.to_string());
135135

tools/xtask/src/cut_release.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn wait_for_release_completion(sh: &Shell) -> anyhow::Result<()> {
4343

4444
if !actions_completed {
4545
println!(
46-
"A relase or a release plan is in progress ... [next poll: {}s]",
46+
"A release or a release plan is in progress ... [next poll: {}s]",
4747
poll_time.as_secs()
4848
);
4949
std::thread::sleep(Duration::from_secs(12));
@@ -116,12 +116,12 @@ fn perform_prechecks(sh: &Shell) -> anyhow::Result<()> {
116116
}
117117

118118
// Error out if there are untracked files/staging changes
119-
let uncommited_stuff = {
119+
let uncommitted_stuff = {
120120
let cmd = cmd!(sh, "git status --porcelain");
121121
let output = cmd.output()?;
122122
String::from_utf8(output.stdout)?
123123
};
124-
if !uncommited_stuff.is_empty() {
124+
if !uncommitted_stuff.is_empty() {
125125
eprintln!("Please clear your staging area and retry!");
126126
std::process::exit(1);
127127
}

typos.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
[files]
22
extend-exclude = ["tests/*", "benchmarks/*"]
3+
4+
[default.extend-words]
5+
nd = "nd"

0 commit comments

Comments
 (0)