Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt pre commit and Ruff #23

Merged
merged 7 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .flake8

This file was deleted.

23 changes: 0 additions & 23 deletions .mypy.ini

This file was deleted.

70 changes: 70 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
ci:
# Don't push commits on to PRs. If you want this, it can be triggered with a
# comment in a PR with text "pre-commit.ci autofix"
autofix_prs: false

repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: "23.9.1"
hooks:
# With notebook support:
# - id: black-jupyter
- id: black

- repo: https://github.com/asottile/blacken-docs
rev: "1.16.0"
hooks:
- id: blacken-docs
additional_dependencies: [black==23.9.1]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
# - id: end-of-file-fixer
# - id: mixed-line-ending
- id: name-tests-test
args: ["--pytest-test-first"]
# - id: trailing-whitespace

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.291"
hooks:
- id: ruff
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]

# Does it make sense to run MyPy with pre-commit? I thought I'd seen the
# authors advise against.
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: "v1.5.1"
# hooks:
# - id: mypy
# files: src|tests
# args: []
# additional_dependencies:
# - pytest

# TODO: Configure in pyproject.toml
- repo: https://github.com/codespell-project/codespell
rev: "v2.2.5"
hooks:
- id: codespell
exclude: "^.*\\.bin$|^.*\\.ipynb$|^.*json"

# TODO: ENABLE SHELLCHECK!
# - repo: https://github.com/shellcheck-py/shellcheck-py
# rev: "v0.9.0.5"
# hooks:
# - id: shellcheck
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/nsidc/snow-today-webapp-server/main.svg)](https://results.pre-commit.ci/latest/github/nsidc/snow-today-webapp-server/main)

# Snow Today Webapp Server

Generate and serve data supporting the [Snow Today
Expand Down
Loading