Skip to content

Commit

Permalink
Add linting
Browse files Browse the repository at this point in the history
  • Loading branch information
timkpaine committed Sep 12, 2024
1 parent 2431f9a commit 9f571ce
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ jobs:

- name: Install dependencies
run: |
python -m pip install -U pytest
python -m pip install -e .[test]
- name: Lint
run: |
ruff format --check sphinxcontrib
ruff check sphinxcontrib
- name: Test
run: |
pytest
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[tool.ruff]
line-length = 150

[tool.ruff.lint]
extend-select = ["I"]

[tool.ruff.lint.isort]
combine-as-imports = true
default-section = "third-party"
known-first-party = ["sphinxcontrib.mermaid"]
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder",
]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403"]
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def remove_block(text, token, margin=0):
"Topic :: Utilities",
],
platforms="any",
packages=find_namespace_packages(where='./', include=['sphinxcontrib.mermaid']),
package_dir={'': './'},
packages=find_namespace_packages(where="./", include=["sphinxcontrib.mermaid"]),
package_dir={"": "./"},
include_package_data=True,
install_requires=["sphinx", "pyyaml"],
extras_require={'test': ['myst-parser', 'defusedxml', 'sphinx', 'pytest']},
extras_require={"test": ["defusedxml", "myst-parser", "pytest", "ruff", "sphinx"]},
)

0 comments on commit 9f571ce

Please sign in to comment.