@@ -67,17 +67,43 @@ filterwarnings = [
67
67
" error" ,
68
68
]
69
69
70
- [tool .bandit ]
71
- # Excluding tests because bandit doesn't like `assert`.
72
- exclude_dirs = [" docs/conf.py" , " tests" ]
70
+ [tool .ruff ]
71
+ line-length = 88
72
+ extend-include = [" *.ipynb" ]
73
+ extend-exclude = [
74
+ " .*" , " __pycache__" , " build" , " dist" , " install" ,
75
+ ]
76
+
77
+ [tool .ruff .lint ]
78
+ # See https://docs.astral.sh/ruff/rules/
79
+ select = [" B" , " C4" , " DTZ" , " E" , " F" , " G" , " I" , " PERF" , " PGH" , " PT" , " PYI" , " RUF" , " S" , " T20" , " UP" , " W" ]
80
+ ignore = [
81
+ # Conflict with ruff format, see
82
+ # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
83
+ " COM812" , " COM819" , " D206" , " D300" , " E111" , " E114" , " E117" , " ISC001" , " ISC002" , " Q000" , " Q001" , " Q002" , " Q003" , " W191" ,
84
+ ]
85
+ fixable = [" I001" , " B010" ]
86
+ isort.known-first-party = [" scicat-filewriter-ingest" ]
87
+ pydocstyle.convention = " numpy"
73
88
74
- [tool .black ]
75
- skip-string-normalization = true
89
+ [tool .ruff .lint .per-file-ignores ]
90
+ # those files have an increased risk of relying on import order
91
+ "__init__.py" = [" I" ]
92
+ "tests/*" = [
93
+ " S101" , # asserts are fine in tests
94
+ " B018" , # 'useless expressions' are ok because some tests just check for exceptions
95
+ ]
96
+ "*.ipynb" = [
97
+ " E501" , # longer lines are sometimes more readable
98
+ " F403" , # *-imports used with domain types
99
+ " F405" , # linter may fail to find names because of *-imports
100
+ " I" , # we don't collect imports at the top
101
+ " S101" , # asserts are used for demonstration and are safe in notebooks
102
+ " T201" , # printing is ok for demonstration purposes
103
+ ]
76
104
77
- [tool .isort ]
78
- skip_gitignore = true
79
- profile = " black"
80
- known_first_party = [" scicat-filewriter-ingest" ]
105
+ [tool .ruff .format ]
106
+ quote-style = " preserve"
81
107
82
108
[tool .mypy ]
83
109
strict = true
0 commit comments