-
Notifications
You must be signed in to change notification settings - Fork 11
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
3 changed files
with
106 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ jobs: | |
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e ".[develop]" | ||
- uses: pre-commit/[email protected] | ||
- name: Run tests and collect coverage | ||
run: | | ||
# -rA displays the captured output for all tests after they're run | ||
|
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,26 @@ | ||
|
||
repos: | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-executables-have-shebangs | ||
- id: check-yaml | ||
args: [--unsafe] | ||
- id: check-merge-conflict | ||
- id: check-symlinks | ||
- id: mixed-line-ending | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.1.7 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
types_or: [ python, pyi, jupyter ] | ||
args: [ --fix ] | ||
# Run the formatter. | ||
- id: ruff-format | ||
types_or: [ python, pyi, jupyter ] |
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,79 @@ | ||
[build-system] | ||
requires = ["setuptools >= 40.6.0", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
|
||
[coverage.run] | ||
# Coverage.py configuration file | ||
# https://coverage.readthedocs.io/en/latest/config.html | ||
branch = true | ||
source = "whoc/*" | ||
omit = [ | ||
"setup.py", | ||
"tests/*" | ||
] | ||
|
||
|
||
[tool.pytest.ini_options] | ||
testpaths = "tests" | ||
filterwarnings = [ | ||
"ignore::DeprecationWarning:pandas.*:" | ||
] | ||
|
||
|
||
[tool.ruff] | ||
src = ["whoc", "tests"] | ||
line-length = 100 | ||
target-version = "py310" | ||
extend-include = ["*.ipynb"] | ||
ignore-init-module-imports = true | ||
|
||
# See https://github.com/charliermarsh/ruff#supported-rules | ||
# for rules included and matching to prefix. | ||
select = ["E", "F", "I"] | ||
|
||
# F401 unused-import: Ignore until all used isort flags are adopted in ruff | ||
# ignore = ["F401"] | ||
|
||
# Allow autofix for all enabled rules (when `--fix`) is provided. | ||
# fixable = ["A", "B", "C", "D", "E", "F"] | ||
fixable = ["E", "F", "I"] | ||
unfixable = [] | ||
|
||
# Exclude a variety of commonly ignored directories. | ||
exclude = [ | ||
".bzr", | ||
".direnv", | ||
".eggs", | ||
".git", | ||
".hg", | ||
".mypy_cache", | ||
".nox", | ||
".pants.d", | ||
".ruff_cache", | ||
".svn", | ||
".tox", | ||
".venv", | ||
"__pypackages__", | ||
"_build", | ||
"buck-out", | ||
"build", | ||
"dist", | ||
"node_modules", | ||
"venv", | ||
] | ||
|
||
# Allow unused variables when underscore-prefixed. | ||
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" | ||
|
||
|
||
[tool.ruff.isort] | ||
combine-as-imports = true | ||
known-first-party = ["flasc"] | ||
order-by-type = false | ||
|
||
# [tool.ruff.format] | ||
|
||
[tool.ruff.per-file-ignores] | ||
# Ignore `F401` (import violations) in all `__init__.py` files, and in `path/to/file.py`. | ||
"__init__.py" = ["F401"] |