Skip to content

Commit

Permalink
add noxfile
Browse files Browse the repository at this point in the history
  • Loading branch information
sneakers-the-rat committed Jun 21, 2024
1 parent c6f86c3 commit b9aa705
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 4 deletions.
17 changes: 17 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import nox


@nox.session(reuse_venv=True)
def lint(session):
"""Lint code without applying fixes or changes"""
session.install(".[dev]")
session.run("ruff", "check")
session.run("black", "miniscope_io", "--diff")


@nox.session(reuse_venv=True)
def format(session):
"""Lint and format code"""
session.install(".[dev]")
session.run("ruff", "check", "--fix")
session.run("black", "miniscope_io")
57 changes: 55 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@ autodoc-pydantic = {version="^2.0.1", optional=true}
black = {version="^24.1.1", optional=true}
ruff = {version="^0.2.0", optional=true}
pre-commit = {version = "^3.7.1", optional = true}
nox = {version = ">=2024.4.15", optional = true}

[tool.poetry.extras]
tests = ["pytest", "pytest-timeout", "matplotlib"]
docs = ["sphinx", "furo", "myst-parser", "autodoc-pydantic", "matplotlib"]
plot = ["matplotlib"]
dev = [
"black", "ruff", "pre-commit",
"black", "ruff", "pre-commit", "nox",
# tests
"pytest", "pytest-timeout", "matplotlib",
# docs
Expand All @@ -79,7 +80,7 @@ updateDevice = "miniscope_io.device_update:updateDevice"
[tool.ruff]
target-version = "py311"
include = ["miniscope_io/**/*.py", "pyproject.toml"]
exclude = ["tests", "miniscope_io/vendor"]
exclude = ["tests", "miniscope_io/vendor", "noxfile.py"]
line-length = 100

[tool.ruff.lint]
Expand Down

0 comments on commit b9aa705

Please sign in to comment.