@@ -54,3 +54,89 @@ write_to = "src/techcable/orderedset/_version.py"
5454
5555[tool .ruff ]
5656line-length = 120
57+ exclude = [
58+ # this is in .gitignore - but for some reason its still triggering `UP` lints
59+ " src/techcable/orderedset/_version.py" ,
60+ ]
61+
62+ [tool .ruff .lint ]
63+ preview = true
64+ extend-select = [
65+ " RUF" , # ruff
66+ " B" , # flake8-bugbear
67+ # probable bugs
68+ " DTZ" , # flake8-datetimez - timezone issues
69+ " EXE" , # issues with shebang
70+ " RET" , # return statements
71+ " SLOT" , # require __slots__ for subclasses of immutable types
72+ " T10" , # use of breakpoint()
73+ " FBT" , # boolean flags should not be positional args
74+ # possible bugs
75+ " BLE" , # prevent over-broad `catch` statements
76+ " PIE" , # flake8-pie - misc lints
77+ " PYI" , # lint pyi files
78+ " PLE" , # pylint[error]
79+ " PLR" , # pylint[refactor]
80+ " LOG" , # flake8-logging
81+ " PT" , # flake8-pytest-style
82+ " ASYNC" , # flake8-async
83+ # lints for legacy code
84+ " UP" , # pyupgrade
85+ " YTT" , # flake8-2020
86+ " C4" , # flake8-comprehensions
87+ " FA" , # flake-future-annotations
88+ " PLR" , # pylint[refactor]
89+ " FURB" , # refurb
90+ # style
91+ " Q002" , # avoid single-quote docstrings
92+ " Q003" , # change outer quotes to avoid escaping inner quotes
93+ " Q004" , # unecessary quote escape
94+ " TD" , # checks todo statements are well-formed
95+ " PTH" , # prefer use of pathlib.Path
96+ " FLY" , # prefer fstring to str.json
97+ " W" , # pycodestyle
98+ " G" , # flake8-logging-format
99+ " N" , # pep8-naming
100+ # pedantic
101+ " SIM" , # flake8-simplify
102+ " A" , # falke8-builtins - prevent shadowing builtins
103+ " T20" , # flake8-print - prevent use of `print` statement
104+ " TC" , # flake8-type-checking - guard imports needed only for type-checking
105+ " TID252" , # forbid relative imports
106+ # "D", # pydocstyle - require docstrings to be well-written
107+ " PLW" , # pylint[warning]
108+ " PLC" , # pylint[convention]
109+ " F" , # pyflakes
110+ " TRY" , # tryceratops
111+ " ERA" , # eradicate - forbid commented out code
112+ # "FIX", # prevent use of todo comments
113+ # buggy lints
114+ # "SLF", # flake8-self - doesn't consider isinstance
115+ # "CPY", # flake8-copyright - require copyright header - doesn't support SPDX tags
116+ ]
117+ ignore = [
118+ # moderately pedantic
119+ # "E741", # ambiguous variable names
120+ " PLW3201" , # allow dunder methods with 'no special meaning'
121+ # extremely pedantic
122+ " PLR2004" , # allow use of 'magic values' - `if x == 3` is fine
123+ " PYI025" , # collections.abc.Set is not confusing with `set`
124+ " UP015" , # allow passing redundant modes to `open()` - explicit is better than implicit
125+ " TRY003" , # allow long error messages 'outside of exception class'
126+ " SIM105" , # allow try/except/pass instead of contextlib.suppress
127+ " RET505" , # use of return statement in `if` does not make `else` unecessary
128+ " PLR0904" , # too many public methods
129+ ]
130+
131+ [tool .ruff .lint .pydocstyle ]
132+ convention = " pep257"
133+
134+ [tool .ruff .lint .per-file-ignores ]
135+ "tests/**" = [
136+ # excessively pedantic
137+ " D" , # pydocstyle
138+ " E741" , # ambigous variable names
139+ " TC" , # flake8-type-checking - import guards are useless here
140+ # moderately pedantic
141+ " CPY" , # test files don't need copyright
142+ ]
0 commit comments