Skip to content
Merged
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
4 changes: 1 addition & 3 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ jobs:
- name: Lint
run: |
set -euo pipefail
# Tell us what version we are using
ruff version
# Check the source file, ignore type annotations (ANN) for now.
ruff check numpy_financial/ benchmarks/ --ignore F403 --select E,F,B,I
ruff check numpy_financial/ benchmarks/
- name: Build project
run: |
spin build -v
Expand Down
19 changes: 19 additions & 0 deletions .spin/cmds.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import click
import spin

@click.command()
@click.option(
'--fix',
is_flag=True,
default=False,
required=False,
)
def lint(fix):
"""🔦 Run lint and typing checks

"""
ruff_flags = ["--fix"] if fix else []
spin.util.run(["ruff", "check", "numpy_financial/", "benchmarks/"] + ruff_flags)

spin.util.run(["pyright"])
spin.util.run(["mypy", "--no-incremental", "."])
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ doc = [
dev = [
"ruff>=0.11.5",
"asv>=0.6.0",
"mypy",
"pyright"
]


Expand Down Expand Up @@ -82,6 +84,8 @@ exclude = [
]
stubPath = "."
typeCheckingMode = "standard"
# _cfinancial is a Cython extension, so we only have a .pyi stub
reportMissingModuleSource = "none"


[tool.spin]
Expand All @@ -103,3 +107,11 @@ package = 'numpy_financial'
"spin.cmds.meson.python",
"spin.cmds.meson.run"
]
"Lint" = [
".spin/cmds.py:lint"
]


[tool.ruff.lint]
ignore = ["F403"]
select = ["E", "F", "B", "I"]
Loading