File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -71,18 +71,28 @@ repos:
71
71
# hooks:
72
72
# - id: clang-format
73
73
74
- # Python: Ruff linter
74
+ # Python: Ruff linter & formatter
75
75
# https://docs.astral.sh/ruff/
76
76
- repo : https://github.com/astral-sh/ruff-pre-commit
77
77
rev : v0.5.6
78
78
hooks :
79
- # Run the linter.
79
+ # Run the linter
80
80
- id : ruff
81
81
args : [--fix, --exit-non-zero-on-fix]
82
82
types_or : [python, jupyter]
83
- # Run the formatter.
83
+ # Run the formatter
84
84
- id : ruff-format
85
85
86
+ # Sorts Python imports according to PEP8
87
+ # https://www.python.org/dev/peps/pep-0008/#imports
88
+ # Needed until https://github.com/astral-sh/ruff/issues/12872 is fixed
89
+ - repo : https://github.com/pycqa/isort
90
+ rev : 5.13.2
91
+ hooks :
92
+ - id : isort
93
+ name : isort (python)
94
+ args : ["--profile", "black", "--filter-files"]
95
+
86
96
# Jupyter Notebooks: clean up all cell outputs
87
97
- repo : https://github.com/roy-ht/pre-commit-jupyter
88
98
rev : v1.2.1
Original file line number Diff line number Diff line change @@ -7,16 +7,12 @@ requires = [
7
7
]
8
8
build-backend = " setuptools.build_meta"
9
9
10
- [tool .flake8 ]
11
- # ignore = ['E231', 'E241']
12
- select = [' F' , ' B' ]
13
-
14
10
[tool .ruff .format ]
15
11
docstring-code-format = true
16
12
17
13
[tool .ruff .lint ]
18
- ignore = [" E402" , " E501" ]
19
14
select = [" E" , " F" , " I" ]
15
+ ignore = [" E402" , " E501" ]
20
16
21
17
[tool .ruff .lint .isort ]
22
18
known-first-party = [" amrex" ]
You can’t perform that action at this time.
0 commit comments