-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathsetup.cfg
More file actions
78 lines (72 loc) · 2.89 KB
/
Copy pathsetup.cfg
File metadata and controls
78 lines (72 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# flake8 configuration for LLTFI
#
# Install: pip install flake8 flake8-bugbear
# Run: flake8 bin/ test_suite/SCRIPTS/ tools/
# Or: lint.sh (runs flake8 automatically)
[flake8]
# 120 chars matches the practical line length used in existing scripts.
max-line-length = 120
# Files / directories to skip
exclude =
# Build artifacts
build/,
__pycache__/,
*.egg-info/,
# Third-party vendored code
tools/zgrviewer/
# Ignored error codes
extend-ignore =
# E203: whitespace before ':' — conflicts with slice notation
E203,
# W503: line break before binary operator — PEP 8 now recommends this style
W503,
# E501: line too long — already handled by max-line-length above
E501,
# -----------------------------------------------------------------------
# Pre-existing whitespace / formatting debt across all legacy scripts.
# These are suppressed globally because touching every legacy file for
# pure style would produce an enormous, review-unfriendly diff.
# New files must follow CODING_GUIDELINES.md (4-space indent, PEP 8).
# TODO: reformat legacy files incrementally and remove these ignores.
# -----------------------------------------------------------------------
# Indentation
E111, E114, E117,
# Blank lines around functions / classes
E301, E302, E303, E305, E306,
# Whitespace around operators and after punctuation
E225, E231, E241, E251,
# Whitespace inside brackets / before inline comment
E201, E202, E261, E262,
# Comment formatting (block comments not starting with '# ')
E265, E266,
# Trailing whitespace on lines and blank lines
W291, W293,
# Continuation line indentation
E121, E122, E123, E124, E125, E126, E127, E128, E131,
# Multiple imports on one line — pre-existing in batch scripts
E401,
# Tab indentation and mixed tabs/spaces — pre-existing in batch/test helpers
W191, E101,
# Misc whitespace patterns widespread in legacy scripts
E211, E221, E222, E272, E275, E502,
# Multiple statements on one line — pre-existing
E701,
# Visually indented line with same indent as next logical line
E129
# Per-file ignores
per-file-ignores =
# bin/ and test scripts use sys.path.append() before local imports
bin/*.py: E402
test_suite/SCRIPTS/*.py: E402
# flake8-bugbear (B*) checks — enforces several coding guidelines:
# B001: bare except (guidelines: never use bare except:)
# B006: mutable default arguments
# B007: loop variable unused
# B009/B010: use getattr/setattr instead of direct access
# B011: assert False should be raise AssertionError
# B023: function definition in loop
# B904: raise ... from err in except blocks
extend-select = B
# Specifically require these bugbear rules that map to our guidelines:
# B001 — no bare except:
# B602 — no subprocess(shell=True) [requires flake8-bugbear >= 22.x]