Skip to content

Commit 3673372

Browse files
committed
Fix cspell warnings
1 parent 993ea89 commit 3673372

File tree

30 files changed

+79
-50
lines changed

30 files changed

+79
-50
lines changed

.cspell.dict/cpython.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ SA_ONSTACK
4545
stackdepth
4646
stringlib
4747
structseq
48+
subparams
4849
tok_oldval
50+
tvars
4951
unaryop
5052
unparse
5153
unparser

.cspell.dict/python-more.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ getrandom
8484
getrecursionlimit
8585
getrefcount
8686
getsizeof
87+
getswitchinterval
8788
getweakrefcount
8889
getweakrefs
8990
getwindowsversion
@@ -167,13 +168,17 @@ pycs
167168
pyexpat
168169
PYTHONBREAKPOINT
169170
PYTHONDEBUG
171+
PYTHONDONTWRITEBYTECODE
170172
PYTHONHASHSEED
171173
PYTHONHOME
172174
PYTHONINSPECT
175+
PYTHONINTMAXSTRDIGITS
176+
PYTHONNOUSERSITE
173177
PYTHONOPTIMIZE
174178
PYTHONPATH
175179
PYTHONPATH
176180
PYTHONSAFEPATH
181+
PYTHONUNBUFFERED
177182
PYTHONVERBOSE
178183
PYTHONWARNDEFAULTENCODING
179184
PYTHONWARNINGS
@@ -206,6 +211,7 @@ seennl
206211
setattro
207212
setcomp
208213
setrecursionlimit
214+
setswitchinterval
209215
showwarnmsg
210216
signum
211217
slotnames

.cspell.dict/rust-more.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ arrayvec
33
bidi
44
biguint
55
bindgen
6+
bitand
67
bitflags
78
bitor
9+
bitxor
810
bstr
911
byteorder
1012
byteset
@@ -15,6 +17,7 @@ cranelift
1517
cstring
1618
datelike
1719
deserializer
20+
deserializers
1821
fdiv
1922
flamescope
2023
flate2
@@ -31,6 +34,7 @@ keccak
3134
lalrpop
3235
lexopt
3336
libc
37+
libcall
3438
libloading
3539
libz
3640
longlong

.cspell.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
"GetSet",
6868
"groupref",
6969
"internable",
70+
"jitted",
71+
"jitting",
7072
"lossily",
7173
"makeunicodedata",
7274
"miri",
@@ -85,6 +87,7 @@
8587
"pygetset",
8688
"pyimpl",
8789
"pylib",
90+
"pymath",
8891
"pymember",
8992
"PyMethod",
9093
"PyModule",

common/src/str.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// cspell:ignore uncomputed
12
use crate::atomic::{PyAtomic, Radium};
23
use crate::format::CharLen;
34
use crate::wtf8::{CodePoint, Wtf8, Wtf8Buf};
@@ -424,7 +425,7 @@ pub fn zfill(bytes: &[u8], width: usize) -> Vec<u8> {
424425
}
425426
}
426427

427-
/// Convert a string to ascii compatible, escaping unicodes into escape
428+
/// Convert a string to ascii compatible, escaping unicode-s into escape
428429
/// sequences.
429430
pub fn to_ascii(value: &str) -> AsciiString {
430431
let mut ascii = Vec::new();

compiler/codegen/src/compile.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,7 +2361,7 @@ impl Compiler<'_> {
23612361
// self.jump_to_fail_pop(pc, JumpOp::PopJumpIfFalse)?;
23622362
// }
23632363

2364-
// // Check that the number of subpatterns is not absurd.
2364+
// // Check that the number of sub-patterns is not absurd.
23652365
// if size.saturating_sub(1) > (i32::MAX as usize) {
23662366
// panic!("too many sub-patterns in mapping pattern");
23672367
// // return self.compiler_error("too many sub-patterns in mapping pattern");
@@ -2469,41 +2469,41 @@ impl Compiler<'_> {
24692469
emit!(self, Instruction::CopyItem { index: 1_u32 });
24702470
self.compile_pattern(alt, pc)?;
24712471

2472-
let nstores = pc.stores.len();
2472+
let n_stores = pc.stores.len();
24732473
if i == 0 {
24742474
// Save the captured names from the first alternative.
24752475
control = Some(pc.stores.clone());
24762476
} else {
24772477
let control_vec = control.as_ref().unwrap();
2478-
if nstores != control_vec.len() {
2478+
if n_stores != control_vec.len() {
24792479
return Err(self.error(CodegenErrorType::ConflictingNameBindPattern));
2480-
} else if nstores > 0 {
2480+
} else if n_stores > 0 {
24812481
// Check that the names occur in the same order.
2482-
for icontrol in (0..nstores).rev() {
2483-
let name = &control_vec[icontrol];
2482+
for i_control in (0..n_stores).rev() {
2483+
let name = &control_vec[i_control];
24842484
// Find the index of `name` in the current stores.
2485-
let istores =
2485+
let i_stores =
24862486
pc.stores.iter().position(|n| n == name).ok_or_else(|| {
24872487
self.error(CodegenErrorType::ConflictingNameBindPattern)
24882488
})?;
2489-
if icontrol != istores {
2489+
if i_control != i_stores {
24902490
// The orders differ; we must reorder.
2491-
assert!(istores < icontrol, "expected istores < icontrol");
2492-
let rotations = istores + 1;
2491+
assert!(i_stores < i_control, "expected i_stores < i_control");
2492+
let rotations = i_stores + 1;
24932493
// Rotate pc.stores: take a slice of the first `rotations` items...
24942494
let rotated = pc.stores[0..rotations].to_vec();
24952495
// Remove those elements.
24962496
for _ in 0..rotations {
24972497
pc.stores.remove(0);
24982498
}
24992499
// Insert the rotated slice at the appropriate index.
2500-
let insert_pos = icontrol - istores;
2500+
let insert_pos = i_control - i_stores;
25012501
for (j, elem) in rotated.into_iter().enumerate() {
25022502
pc.stores.insert(insert_pos + j, elem);
25032503
}
25042504
// Also perform the same rotation on the evaluation stack.
2505-
for _ in 0..(istores + 1) {
2506-
self.pattern_helper_rotate(icontrol + 1)?;
2505+
for _ in 0..(i_stores + 1) {
2506+
self.pattern_helper_rotate(i_control + 1)?;
25072507
}
25082508
}
25092509
}

compiler/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub fn compile(
9393
source_path: &str,
9494
opts: CompileOpts,
9595
) -> Result<CodeObject, CompileError> {
96-
// TODO: do this less hackily; ruff's parser should translate a CRLF line
96+
// TODO: do this less hacky; ruff's parser should translate a CRLF line
9797
// break in a multiline string into just an LF in the parsed value
9898
#[cfg(windows)]
9999
let source = &source.replace("\r\n", "\n");

example_projects/frozen_stdlib/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// cspell:ignore aheui
12
/// Setting up a project with a frozen stdlib can be done *either* by using `rustpython::InterpreterConfig` or `rustpython_vm::Interpreter::with_init`.
23
/// See each function for example.
34
///

examples/parse_folder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn parse_folder(path: &Path) -> std::io::Result<Vec<ParsedFile>> {
5656
let parsed_file = parse_python_file(&path);
5757
match &parsed_file.result {
5858
Ok(_) => {}
59-
Err(y) => error!("Erreur in file {path:?} {y:?}"),
59+
Err(y) => error!("Error in file {path:?} {y:?}"),
6060
}
6161

6262
res.push(parsed_file);

jit/tests/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ impl StackMachine {
7777
}
7878

7979
pub fn run(&mut self, code: CodeObject) {
80-
let mut oparg_state = OpArgState::default();
80+
let mut op_arg_state = OpArgState::default();
8181
let _ = code.instructions.iter().try_for_each(|&word| {
82-
let (instruction, arg) = oparg_state.get(word);
82+
let (instruction, arg) = op_arg_state.get(word);
8383
self.process_instruction(instruction, arg, &code.constants, &code.names)
8484
});
8585
}

0 commit comments

Comments
 (0)