Skip to content

Commit

Permalink
ci: update pre-commit, switch to ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed Aug 7, 2024
1 parent db4ebdc commit cf4eeaf
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 25 deletions.
24 changes: 9 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,28 @@
# Please run `pre-commit run --all-files` when adding or changing entries.

repos:
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.3.0
hooks:
- id: codespell
args: [--ignore-words=.codespellignore]
types_or: [jupyter, markdown, python, shell]
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.6
hooks:
- id: flake8
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.2.0
rev: v1.11.1
hooks:
- id: mypy
additional_dependencies:
- click != 8.1.0
- click
- stactools
- pytest
- types-requests
- types-python-dateutil
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.33.0
rev: v0.41.0
hooks:
- id: markdownlint
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
level of experience, education, socioeconomic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ghcr.io/stac-utils/stactools:$STACTOOLS_VERSION

ARG DOCKER_NAMESPACE_PACKAGE_DIR
ARG DOCKER_WORKDIR
ENV PYTHON_VERSION=3.10
ENV PYTHON_VERSION=3.11
WORKDIR $DOCKER_WORKDIR

# For caching purposes, install dependencies but remove the actual package
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ghcr.io/stac-utils/stactools:${STACTOOLS_VERSION}-dev

ARG DOCKER_NAMESPACE_PACKAGE_DIR
ARG DOCKER_WORKDIR
ENV PYTHON_VERSION=3.10
ENV PYTHON_VERSION=3.11
WORKDIR $DOCKER_WORKDIR

RUN apt-get -y -q update \
Expand Down
4 changes: 1 addition & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
black
codespell
flake8
isort
mypy
pre-commit
pytest
pytest-cov
ruff
types-python-dateutil
types-requests
4 changes: 1 addition & 3 deletions scripts/format
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
if [ "${1:-}" = "--help" ]; then
usage
else
# Sort imports
pre-commit run isort --all-files
# Code formatting
pre-commit run black --all-files
pre-commit run ruff-format --all-files
fi
fi
2 changes: 1 addition & 1 deletion scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
usage
else
# Lint
pre-commit run flake8 --all-files
pre-commit run ruff --all-files
# Type checking
pre-commit run mypy --all-files
fi
Expand Down

0 comments on commit cf4eeaf

Please sign in to comment.