-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
269 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[flake8] | ||
ignore = | ||
# missing-whitespace-around-operator | ||
E225 | ||
# missing-whitespace-around-arithmetic-operator | ||
E226 | ||
# line-too-long | ||
E501 | ||
# unused-import | ||
F401 | ||
# undefined-local-with-import-star | ||
F403 | ||
# redefined-while-unused | ||
F811 | ||
# Line break occurred before a binary operator | ||
W503, | ||
# Line break occurred after a binary operator | ||
W504 | ||
max-line-length = 110 | ||
exclude = | ||
.git | ||
__pycache__ | ||
docs/conf.py | ||
build | ||
streamtracer/__init__.py, | ||
rst-directives = | ||
plot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,41 @@ | ||
|
||
repos: | ||
# Sort order of Python imports | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
# Python code formatting | ||
- repo: https://github.com/psf/black | ||
rev: 24.2.0 | ||
# This should be before any formatting hooks like isort | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: "v0.2.1" | ||
hooks: | ||
- id: ruff | ||
args: ["--fix"] | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-ast | ||
- id: check-case-conflict | ||
- id: trailing-whitespace | ||
exclude: ".*(.fits|.fts|.fit|.header|.txt)$" | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: check-added-large-files | ||
args: ["--enforce-all", "--maxkb=1054"] | ||
- id: end-of-file-fixer | ||
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|.json)$|^CITATION.rst$" | ||
- id: mixed-line-ending | ||
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*)$" | ||
# Run mypy type validation | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: 'v1.8.0' | ||
hooks: | ||
- id: black | ||
# Remove unused Python imports | ||
- repo: https://github.com/PyCQA/autoflake | ||
rev: v2.2.1 | ||
hooks: | ||
- id: autoflake | ||
args: ["--in-place", "--remove-all-unused-imports", "--ignore-init-module-imports"] | ||
# Run mypy type validation | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: 'v1.8.0' | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: [types-setuptools] | ||
|
||
- id: mypy | ||
additional_dependencies: [types-setuptools] | ||
# Sort order of Python imports | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
# Python code formatting | ||
- repo: https://github.com/psf/black | ||
rev: 24.2.0 | ||
hooks: | ||
- id: black | ||
|
||
ci: | ||
autofix_prs: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: 2 | ||
|
||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "mambaforge-4.10" | ||
jobs: | ||
post_checkout: | ||
- git fetch --unshallow || true | ||
pre_install: | ||
- git update-index --assume-unchanged .rtd-environment.yml docs/conf.py | ||
|
||
conda: | ||
environment: .rtd-environment.yml | ||
|
||
sphinx: | ||
builder: html | ||
configuration: docs/conf.py | ||
fail_on_warning: false | ||
|
||
formats: | ||
- htmlzip | ||
|
||
python: | ||
install: | ||
- method: pip | ||
extra_requirements: | ||
- docs | ||
path: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: streamtracer | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- python=3.10 | ||
- pip | ||
- graphviz!=2.42.*,!=2.43.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
target-version = "py310" | ||
line-length = 110 | ||
exclude = [ | ||
".git,", | ||
"__pycache__", | ||
"build", | ||
"streamtracer/version.py", | ||
] | ||
|
||
[lint] | ||
select = ["E", "F", "W", "UP", "PT"] | ||
extend-ignore = [ | ||
# pycodestyle (E, W) | ||
"E501", # LineTooLong # TODO! fix | ||
# pytest (PT) | ||
"PT001", # Always use pytest.fixture() | ||
"PT004", # Fixtures which don't return anything should have leading _ | ||
"PT007", # Parametrize should be lists of tuples # TODO! fix | ||
"PT011", # Too broad exception assert # TODO! fix | ||
"PT023", # Always use () on pytest decorators | ||
] | ||
|
||
[flake8-tidy-imports] | ||
[flake8-tidy-imports.banned-api] | ||
"warnings.warn".msg = "Use sunpy specific warning helpers warn_* from sunpy.utils.exceptions" | ||
|
||
[per-file-ignores] | ||
# Part of configuration, not a package. | ||
"setup.py" = ["INP001"] | ||
"conftest.py" = ["INP001"] | ||
# Implicit-namespace-package. The examples are not a package. | ||
"docs/*.py" = ["INP001"] | ||
"__init__.py" = ["E402", "F401", "F403"] | ||
"test_*.py" = ["B011", "D", "E402", "PGH001", "S101"] | ||
# Need to import clients to register them, but don't use them in file | ||
"streamtracer/net/__init__.py" = ["F811"] | ||
|
||
[pydocstyle] | ||
convention = "numpy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters