-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ruff #100
base: main
Are you sure you want to change the base?
Add ruff #100
Changes from 19 commits
8b1e63e
8bb3709
3d57f78
04a6bd6
94c7277
47daf23
5ecdc9f
89022be
141b673
f54a539
9dc99f1
84e6e9e
fcf4770
a7ac4bb
383d2f1
0018d83
4a334d3
b01b6e9
aae1af2
10e76f3
102df11
19da71e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,136 @@ | ||
[build-system] | ||
requires = ["setuptools >= 40.6.0", "wheel"] | ||
requires = ["setuptools", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "smarthomeconnect" | ||
version = "0.9.0" | ||
description = "The Smart Home Connect home automation framework based on AsyncIO" | ||
license = {file = "LICENSE"} | ||
readme = "README.md" | ||
authors = [{name = "Michael Thies", email = "mail@mhthies.de"}] | ||
requires-python = ">=3.7" | ||
dependencies = [ | ||
"aiohttp>=3.6,<4", | ||
"jinja2>=2.11,<4", | ||
"MarkupSafe>=1.1,<3", | ||
] | ||
|
||
[tool.setuptools] | ||
packages = ["shc"] | ||
|
||
[project.optional-dependencies] | ||
mysql = ["aiomysql>=0.0.21,<=0.2.0"] | ||
knx = ["knxdclient>=0.4.0,<2"] | ||
dmx = ["pyserial-asyncio>=0.3,<0.7"] | ||
midi = ["mido>=1.2.9,<2", "python-rtmidi>=1.4.6,<2"] | ||
mqtt = ["aiomqtt>=2.0.0,<3"] | ||
pulse = ["pulsectl_asyncio>=1.0.0,<2"] | ||
telegram = ["aiogram>=3.0,<4"] | ||
file_persistence = ["aiofile>=3.7.4,<4"] | ||
dev = ["ruff~=0.8"] | ||
test = [ | ||
"coverage~=7.6", | ||
"mypy~=1.13", | ||
"selenium>=3.141,<5", | ||
"types-PyMySQL", | ||
"types-MarkupSafe>=1.1,<3", | ||
"types-Jinja2>=2.11,<3", | ||
] | ||
doc = [ | ||
"sphinx~=5.0", | ||
"sphinx-rtd-theme~=2.0", | ||
"sphinx-toolbox~=3.5", | ||
"sphinxcontrib-httpdomain~=1.8", | ||
] | ||
|
||
[tool.ruff] | ||
line-length = 120 | ||
output-format = "concise" | ||
exclude = [ | ||
".cache", | ||
".git", | ||
"dist", | ||
"docs", | ||
"htmlcov", | ||
"node_modules", | ||
"venv", | ||
"venv*", | ||
".mypy_cache", | ||
"test/assets", | ||
] | ||
|
||
[tool.ruff.lint] | ||
# Enable checks for Pycodestyle, Pyflakes, Bugbear, Docstrings and Import sorting | ||
select = ["E", "F", "B", "D", "I"] | ||
ignore = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBD all these errors occur, currently disabled so we could merge the current state. |
||
"B006", # Do not use mutable data structures for argument defaults | ||
"B007", # Loop control variable `i` not used within loop body | ||
"B012", # `return` inside `finally` blocks cause exceptions to be silenced | ||
"B015", # Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it. # FIXME: enable again | ||
"B018", # Found useless expression. Either assign it to a variable or remove it. # FIXME: enable again | ||
"B023", # Function definition does not bind loop variable `spec` | ||
"B024", # abstract base class, but it has no abstract methods or properties | ||
"B027", # empty method in an abstract base class, but has no abstract decorator | ||
"B028", # No explicit `stacklevel` keyword argument found | ||
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling | ||
"D100", # Missing docstring in public module # FIXME: enable again | ||
"D101", # Missing docstring in public class # FIXME: enable again | ||
"D102", # Missing docstring in public method # FIXME: enable again | ||
"D103", # Missing docstring in public function # FIXME: enable again | ||
"D104", # Missing docstring in public package # FIXME: enable again | ||
"D105", # Missing docstring in magic method | ||
"D106", # Missing docstring in public nested class | ||
"D107", # Ignore D107 Missing docstring # FIXME: enable again??? | ||
"D200", # One-line docstring should fit on one line | ||
"D202", # No blank lines allowed after function docstring (found 1) | ||
"D203", # Ignore one-blank-line-before-class as Black handles this | ||
"D204", # 1 blank line required after class docstring | ||
"D205", # 1 blank line required between summary line and description | ||
"D209", # Multi-line docstring closing quotes should be on a separate line | ||
"D210", # No whitespaces allowed surrounding docstring text | ||
"D211", # No blank lines allowed before class docstring | ||
"D212", # Multi-line docstring summary should start at the first line | ||
"D213", # Multi-line docstring summary should start at the second line | ||
"D301", # Use `r"""` if any backslashes in a docstring | ||
"D400", # First line should end with a period | ||
"D401", # First line of docstring should be in imperative mood | ||
"D402", # First line should not be the function's signature | ||
"D404", # First word of the docstring should not be "This" | ||
"D415", # First line should end with a period, question mark, or exclamation point | ||
"E226", # Missing whitespace around arithmetic operator # FIXME: enable again | ||
"E241", # Multiple spaces after comma # FIXME: enable again | ||
"I001", # Import block is un-sorted or un-formatted # FIXME: enable again | ||
] | ||
preview = true | ||
|
||
[tool.ruff.lint.per-file-ignores] | ||
"*/__init__.py" = ["F401"] | ||
"example/*" = ["F403", "F405"] | ||
|
||
[tool.mypy] | ||
files = ["shc/", "test/", "example/"] | ||
disallow_untyped_decorators = true | ||
warn_unreachable = true | ||
check_untyped_defs = true | ||
namespace_packages = false | ||
plugins = ["shc/util/mypy_variable_plugin.py"] | ||
exclude = "^test/assets/mypy_plugin_test" | ||
|
||
[[tool.mypy.overrides]] | ||
module = "mido,astropy,astropy.*,serial,serial_asyncio,paho.mqtt.*,selenium.*,pulsectl.*,pulsectl_asyncio,aiomysql,aiogram.*" | ||
ignore_missing_imports = true | ||
|
||
[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 | ||
|
||
[tool.isort] | ||
profile = "black" # Use the "black" profile for import sorting consistency with Black | ||
line_length = 120 |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this here to avoid the warning?
WARNING: html_static_path entry '_static' does not exist