Skip to content
Open
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
98 changes: 98 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Configuration file for pre-commit and pre-commit.ci.
#
# To perform automated fixes, either run `pre-commit run --all-files`
# or comment `pre-commit.ci autofix` on a pull request.

ci: # https://pre-commit.ci/#configuration
autofix_prs: false
autoupdate_schedule: monthly

repos: # https://pre-commit.com/#adding-pre-commit-plugins-to-your-project

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-ast
name: check abstract syntax tree
- id: check-merge-conflict
- id: check-case-conflict
- id: check-illegal-windows-names
- id: detect-private-key
- id: fix-byte-order-marker
- id: mixed-line-ending
args: [--fix=lf]
exclude: docs/make.bat
- id: forbid-submodules
- id: check-toml
- id: check-yaml
# - id: trailing-whitespace
# - id: end-of-file-fixer
# - id: name-tests-test

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.15.0
hooks:
- id: pretty-format-yaml
args: [--autofix]
files: .pre-commit-config.yaml
# - id: pretty-format-ini
# args: [--autofix]

- repo: https://github.com/sirosen/texthooks
rev: 0.7.1
hooks:
# - id: fix-smartquotes
- id: fix-spaces
- id: fix-ligatures
- id: forbid-bidi-controls

#- repo: https://github.com/astral-sh/ruff-pre-commit
# rev: v0.14.5
# hooks:
# - id: ruff-check
# name: ruff-check (see https://docs.astral.sh/ruff/rules)
# args: [--fix]
# - id: ruff-format

#- repo: https://github.com/sphinx-contrib/sphinx-lint
# rev: v1.0.1
# hooks:
# - id: sphinx-lint

- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
name: codespell (add false positives to pyproject.toml)
# temporarily exclude most files since suggested changes require some thought
exclude: pyspedas|docs/source
# args: [--write-changes]

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.35.0
hooks:
- id: check-github-workflows

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.24.1
hooks:
- id: validate-pyproject
name: validate pyproject.toml
additional_dependencies: ['validate-pyproject-schema-store[all]']

# - repo: https://github.com/tox-dev/pyproject-fmt
# rev: v2.11.1
# hooks:
# - id: pyproject-fmt
# name: format pyproject.toml
Comment on lines +83 to +87
Copy link
Copy Markdown
Author

@namurphy namurphy Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hook would impose a particular opinionated style for pyproject.toml. It does help keep the file organized, but this one is fine to skip if you don't like the style.


# - repo: https://github.com/hukkin/mdformat
# rev: 1.0.0
# hooks:
# - id: mdformat
# name: format .md files
# additional_dependencies:
# - mdformat-footnote
# - mdformat-gfm
# - mdformat-gfm-alerts
# - mdformat-ruff
Comment on lines +89 to +98
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mdformat autoformats Markdown files, and the additional dependencies are for GitHub flavored Markdown.

9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,14 @@ ignore = [
"E501", # Ignore line too long
]

[tool.codespell]
skip = "*.png,*.jpg,*.jpeg,*cache*,*egg*,.git,.hypothesis,.idea,.nox,.tox,_build,venv,*.lock"
# Add false positives found by codespell to ignore-words-list
ignore-words-list = """
fo,
inout,
tha,
thi"""
Comment on lines +173 to +177
Copy link
Copy Markdown
Author

@namurphy namurphy Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a subset of the possible misspellings that codespell is finding.


[tool.pylint]
disable = ["line-too-long", "too-many-arguments",]