-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to Ruff for formatting/linting
TODO: update GitHub CI
- Loading branch information
Showing
17 changed files
with
151 additions
and
154 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 |
---|---|---|
|
@@ -26,3 +26,7 @@ indent_size = 2 | |
[*.rst] | ||
indent_style = space | ||
indent_size = 3 | ||
|
||
[*.toml] | ||
indent_style = space | ||
indent_size = 4 |
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,18 +1,27 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.10.1 | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version (should be consistent with `pdm.lock` | ||
rev: v0.4.6 | ||
hooks: | ||
- id: black | ||
# Run the linter. | ||
- id: ruff | ||
# Run the formatter. | ||
- id: ruff-format | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.12.0 | ||
- repo: https://github.com/pdm-project/pdm | ||
rev: 2.15.4 | ||
hooks: | ||
- id: isort | ||
# Ensure lock file is consistent with pyproject.toml | ||
- id: pdm-lock-check | ||
# Export python requirements | ||
- id: pdm-export | ||
args: ['-o', 'requirements.txt', '--without-hashes'] | ||
files: ^pdm.lock$ |
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
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,4 +1,5 @@ | ||
"""Functionality for exporting and importing application data.""" | ||
|
||
from __future__ import annotations | ||
|
||
import re | ||
|
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
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
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,4 +1,5 @@ | ||
"""Configuration for Pyramid's interactive pshell.""" | ||
|
||
from . import models | ||
|
||
|
||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -6,16 +6,16 @@ build-backend = "pdm.backend" | |
name = "mesh-info" | ||
description = "Collect and display information about an AREDN mesh network." | ||
readme = "README.rst" | ||
authors = [{name = "Scott Seary", email = "[email protected]"}] | ||
authors = [{ name = "Scott Seary", email = "[email protected]" }] | ||
requires-python = ">=3.9" | ||
license = {text = "GNU General Public License v3 (GPLv3)"} | ||
license = { text = "GNU General Public License v3 (GPLv3)" } | ||
keywords = ["aredn", "mesh"] | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Development Status :: 3 - Alpha", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
] | ||
dependencies = [ | ||
"aiohttp ~= 3.9.5", | ||
|
@@ -49,11 +49,6 @@ Documentation = "https://mesh-info-ki7onk.readthedocs.io/" | |
[project.scripts] | ||
meshinfo = "meshinfo.cli:main" | ||
|
||
[tool.isort] | ||
profile = "black" | ||
known_third_party = "alembic" | ||
|
||
[tool.pdm] | ||
[tool.pdm.dev-dependencies] | ||
testing = [ | ||
"Faker>=25.3.0", | ||
|
@@ -76,3 +71,42 @@ ruff = [ | |
mypy = [ | ||
"mypy>=1.10.0", | ||
] | ||
|
||
[tool.ruff] | ||
target-version = "py39" | ||
|
||
[tool.ruff.format] | ||
exclude = ["alembic/versions/*.py"] | ||
|
||
[tool.ruff.lint] | ||
select = [ | ||
"A", # flake8-builtins | ||
"B", # flake8-bugbear" | ||
"C4", # flake8-comprehensions | ||
"C90", # mccabe | ||
"E", "W", # pycodestyle | ||
"F", # pyflakes | ||
"I", # isort | ||
"N", # pep8-naming | ||
"PLC", "PLE", "PLW", # "PLR" # pylint | ||
"YTT", # flake8-2020 | ||
# "D", # pydocstyle | ||
# "RET", # flake8-return | ||
# "SIM", # flake8-simplify | ||
# "UP", # pyupgrade | ||
] | ||
ignore = [ | ||
"A003", # builtin-attribute-shadowing | ||
"C416", # unnecessary `dict` comprehension | ||
"D105", # magic-method | ||
"D107", # public-init | ||
"D203", # one-blank-line-before-class | ||
"D213", # multi-line-summary-second-line | ||
"PLR2004", # magic-value-comparison | ||
] | ||
|
||
[tool.ruff.lint.isort] | ||
known-third-party = ["alembic"] | ||
|
||
[tool.ruff.lint.mccabe] | ||
max-complexity = 12 |
Oops, something went wrong.