Skip to content

Commit

Permalink
Ruff: Run on pyi files (#356)
Browse files Browse the repository at this point in the history
* Ruff: Run on pyi files

Ensure ruff is actually run on `.pyi` files.
They have a separate type `pyi` but we can just use the defaults, too

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
ax3l and pre-commit-ci[bot] authored Aug 14, 2024
1 parent c61add4 commit abdf332
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 24 deletions.
13 changes: 1 addition & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,14 @@ repos:
# Python: Ruff linter & formatter
# https://docs.astral.sh/ruff/
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.6
rev: v0.5.7
hooks:
# Run the linter
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
types_or: [python, jupyter]
# Run the formatter
- id: ruff-format

# Sorts Python imports according to PEP8
# https://www.python.org/dev/peps/pep-0008/#imports
# Needed until https://github.com/astral-sh/ruff/issues/12872 is fixed
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
args: ["--profile", "black", "--filter-files"]

# Jupyter Notebooks: clean up all cell outputs
- repo: https://github.com/roy-ht/pre-commit-jupyter
rev: v1.2.1
Expand Down
6 changes: 2 additions & 4 deletions src/amrex/space1d/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ from amrex.space1d.amrex_1d_pybind import (
Geometry,
GeometryData,
IndexType,
)
from amrex.space1d.amrex_1d_pybind import IntVect1D
from amrex.space1d.amrex_1d_pybind import IntVect1D as IntVect
from amrex.space1d.amrex_1d_pybind import (
IntVect1D,
IntVect2D,
IntVect3D,
MFInfo,
Expand Down Expand Up @@ -287,6 +284,7 @@ from amrex.space1d.amrex_1d_pybind import (
unpack_ids,
write_single_level_plotfile,
)
from amrex.space1d.amrex_1d_pybind import IntVect1D as IntVect

from . import amrex_1d_pybind

Expand Down
6 changes: 2 additions & 4 deletions src/amrex/space2d/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ from amrex.space2d.amrex_2d_pybind import (
GeometryData,
IndexType,
IntVect1D,
)
from amrex.space2d.amrex_2d_pybind import IntVect2D
from amrex.space2d.amrex_2d_pybind import IntVect2D as IntVect
from amrex.space2d.amrex_2d_pybind import (
IntVect2D,
IntVect3D,
MFInfo,
MFIter,
Expand Down Expand Up @@ -311,6 +308,7 @@ from amrex.space2d.amrex_2d_pybind import (
unpack_ids,
write_single_level_plotfile,
)
from amrex.space2d.amrex_2d_pybind import IntVect2D as IntVect

from . import amrex_2d_pybind

Expand Down
6 changes: 2 additions & 4 deletions src/amrex/space3d/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ from amrex.space3d.amrex_3d_pybind import (
IndexType,
IntVect1D,
IntVect2D,
)
from amrex.space3d.amrex_3d_pybind import IntVect3D
from amrex.space3d.amrex_3d_pybind import IntVect3D as IntVect
from amrex.space3d.amrex_3d_pybind import (
IntVect3D,
MFInfo,
MFIter,
MFItInfo,
Expand Down Expand Up @@ -287,6 +284,7 @@ from amrex.space3d.amrex_3d_pybind import (
unpack_ids,
write_single_level_plotfile,
)
from amrex.space3d.amrex_3d_pybind import IntVect3D as IntVect

from . import amrex_3d_pybind

Expand Down

0 comments on commit abdf332

Please sign in to comment.