Skip to content

Commit

Permalink
Merge pull request #23 from nsidc/adopt-pre-commit-ruff
Browse files Browse the repository at this point in the history
Adopt pre commit and Ruff
  • Loading branch information
mfisher87 authored Oct 10, 2023
2 parents 9902651 + bae3e0d commit b225e0a
Show file tree
Hide file tree
Showing 17 changed files with 327 additions and 452 deletions.
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

0 comments on commit b225e0a

Please sign in to comment.