Skip to content

Commit b55a8df

Browse files
Debug for the functional test
1 parent 077e522 commit b55a8df

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
[main]
1+
[format]
22
strict-engineering-notation = true
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
[main]
1+
[format]
22
strict-scientific-notation = true

pylint/checkers/format.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,12 @@ def __init__(self, linter: PyLinter) -> None:
315315
engineering = self.linter.config.strict_engineering_notation
316316
underscore = self.linter.config.strict_underscore_notation
317317
float_config = sum([scientific, engineering, underscore])
318+
print(
319+
f"scientific: {scientific}, "
320+
f"engineering: {engineering},"
321+
f" underscore; {underscore}"
322+
f" float_config; {float_config}"
323+
)
318324
if float_config > 1:
319325
raise ValueError(
320326
"Only one of strict-scientific-notation, "
@@ -330,6 +336,11 @@ def __init__(self, linter: PyLinter) -> None:
330336
self.should_check_scientific_notation = scientific
331337
self.should_check_engineering_notation = engineering
332338
self.should_check_underscore_notation = underscore
339+
print(
340+
self.should_check_scientific_notation,
341+
self.should_check_engineering_notation,
342+
self.should_check_underscore_notation,
343+
)
333344

334345
def new_line(self, tokens: TokenWrapper, line_end: int, line_start: int) -> None:
335346
"""A new line has been encountered, process it if necessary."""
@@ -641,6 +652,17 @@ def raise_bad_float_notation(suggested: set[str]) -> None:
641652
abs_value = abs(value)
642653
has_underscore = "_" in string
643654
has_exponent = "e" in string or "E" in string
655+
print(
656+
f"Checking {string} {line_num}: "
657+
f"s:{self.should_check_scientific_notation} "
658+
f"e:{self.should_check_engineering_notation} "
659+
f"u;{self.should_check_underscore_notation} "
660+
f"has_underscore: {has_underscore} "
661+
f"has_exponent: {has_exponent} "
662+
f"abs_value: {abs_value} "
663+
f"threshold: {threshold} "
664+
f"strict_scientific_notation: {self.linter.config.strict_scientific_notation} "
665+
)
644666
if has_exponent:
645667
if self.linter.config.strict_underscore_notation:
646668
# If we have exponent it means it's not proper underscore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[main]
1+
[tool.pylint.format]
22
strict-engineering-notation = false
33
strict-scientific-notation = true
44
strict-underscore-notation = false

0 commit comments

Comments
 (0)