-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from TimNekk/develop
Add Ruff Linting
- Loading branch information
Showing
6 changed files
with
82 additions
and
64 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
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,15 @@ | ||
#!/bin/bash | ||
|
||
# Exit script on first error | ||
set -e | ||
|
||
# Check if pylint is installed | ||
if ! pip list | grep ruff; then | ||
# Upgrade pip and install pylint if not installed | ||
python -m pip install --upgrade pip | ||
pip install ruff | ||
fi | ||
|
||
# Run pylint on all Python files in the repository | ||
#find . -name "*.py" -print0 | xargs -0 pylint | ||
ruff check . |
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,53 +1,57 @@ | ||
[tool.flake8] | ||
max-line-length = 120 | ||
[tool.ruff] | ||
# Exclude a variety of commonly ignored directories. | ||
exclude = [ | ||
".bzr", | ||
".direnv", | ||
".eggs", | ||
".git", | ||
"__pycache__", | ||
"docs/source/conf.py", | ||
".git-rewrite", | ||
".hg", | ||
".mypy_cache", | ||
".nox", | ||
".pants.d", | ||
".pytype", | ||
".ruff_cache", | ||
".svn", | ||
".tox", | ||
".venv", | ||
"__pypackages__", | ||
"_build", | ||
"buck-out", | ||
"build", | ||
"dist", | ||
"tests", | ||
"alembic" | ||
] | ||
ignore = [ | ||
"I101", | ||
"D100", | ||
"D101", | ||
"D102", | ||
"D103", | ||
"D104", | ||
"D105", | ||
"D107", | ||
"D401", | ||
"E203", | ||
"I900", | ||
"N802", | ||
"N806", | ||
"N812", | ||
"W503", | ||
"S311", | ||
"S605", | ||
"S607", | ||
"ISC003", | ||
"ISC001", | ||
"T101", | ||
"T000", | ||
"F541", | ||
"PL123", | ||
"E712" | ||
] | ||
per-file-ignores = [ | ||
'__init__.py:F401', | ||
"node_modules", | ||
"venv", | ||
] | ||
|
||
[tool.mypy] | ||
ignore_missing_imports = true | ||
disallow_untyped_defs = true | ||
check_untyped_defs = true | ||
warn_redundant_casts = true | ||
no_implicit_optional = true | ||
strict_optional = true | ||
show_error_codes = true | ||
strict_equality = true | ||
warn_unreachable = true | ||
warn_unused_configs = true | ||
# Same as Black. | ||
line-length = 88 | ||
indent-width = 4 | ||
|
||
# Assume Python 3.10 | ||
target-version = "py310" | ||
|
||
[tool.ruff.lint] | ||
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. | ||
select = ["E4", "E7", "E9", "F"] | ||
ignore = ["E712"] | ||
|
||
# Allow fix for all enabled rules (when `--fix`) is provided. | ||
fixable = ["ALL"] | ||
unfixable = [] | ||
|
||
# Allow unused variables when underscore-prefixed. | ||
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" | ||
|
||
[tool.ruff.format] | ||
# Like Black, use double quotes for strings. | ||
quote-style = "double" | ||
|
||
# Like Black, indent with spaces, rather than tabs. | ||
indent-style = "space" | ||
|
||
# Like Black, respect magic trailing commas. | ||
skip-magic-trailing-comma = false | ||
|
||
# Like Black, automatically detect the appropriate line ending. | ||
line-ending = "auto" |
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,9 +1,9 @@ | ||
aiogram==2.25.1 | ||
aiogram==2.23.1 | ||
aioredis~=2.0 | ||
environs~=9.5 | ||
environs~=9.0 | ||
git+https://github.com/TimNekk/aiogram_broadcaster.git | ||
gino==1.0.1 | ||
loguru==0.7.0 | ||
alembic==1.11.1 | ||
psycopg2==2.9.6 | ||
loguru==0.6.0 | ||
alembic==1.8.1 | ||
psycopg2==2.9.3 | ||
validators==0.20.0 |
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,2 +1,7 @@ | ||
from .send_all import SendAllState | ||
from .ping import PingState | ||
|
||
__all__ = [ | ||
"SendAllState", | ||
"PingState" | ||
] |