Skip to content

Commit

Permalink
Adds isort and codespell to pre-commit (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair authored Mar 11, 2024
2 parents 8d590fb + 773c763 commit 6c4e4f2
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ repos:
exclude: "{{ cookiecutter.package_name }}"
- id: debug-statements
exclude: "{{ cookiecutter.package_name }}"
ci:
autofix_prs: false
13 changes: 13 additions & 0 deletions {{ cookiecutter.package_name }}/.codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[codespell]
skip = *.asdf,*.fits,*.fts,*.header,*.json,*.xsh,*cache*,*egg*,*extern*,.git,.idea,.tox,_build,*truncated,*.svg,.asv_env,.history
ignore-words-list =
alog,
nd,
nin,
observ,
ot,
te,
upto,
afile,
precessed,
precess
16 changes: 16 additions & 0 deletions {{ cookiecutter.package_name }}/.isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[settings]
balanced_wrapping = true
skip =
docs/conf.py,
{{ cookiecutter.module_name }}/__init__.py,
default_section = THIRDPARTY
include_trailing_comma = true
known_astropy = astropy, asdf
known_sunpy = sunpy
known_first_party = {{ cookiecutter.module_name }}
length_sort = false
length_sort_sections = stdlib
line_length = 110
multi_line_output = 3
no_lines_before = LOCALFOLDER
sections = STDLIB, THIRDPARTY, ASTROPY, SUNPY, FIRSTPARTY, LOCALFOLDER
10 changes: 10 additions & 0 deletions {{ cookiecutter.package_name }}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ repos:
hooks:
- id: ruff
args: ["--fix"]
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|{{ cookiecutter.module_name }}/extern)$"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand All @@ -20,6 +25,11 @@ repos:
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|.json)$|^CITATION.rst$"
- id: mixed-line-ending
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*)$"
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args: [ "--write-changes" ]
ci:
autofix_prs: false
autoupdate_schedule: "quarterly"

0 comments on commit 6c4e4f2

Please sign in to comment.