Skip to content

Commit

Permalink
Move to pyproject
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Oct 31, 2024
1 parent ce1e207 commit e060009
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 54 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:
- '**.py' # Run if pushed commits include a change to a Python (.py) file.
- '.github/workflows/lint.yml' # Run if pushed commits include a change to a github actions workflow file.
- 'requirements.txt' # Run if pushed commits include a change to the Python requirements.txt file.
- '.ruff.toml' # Run if ruff configuration file changes.
- '.pyprogject.toml' # Run if project configuration file changes.
pull_request:
paths:
- '**.py' # Run if pushed commits include a change to a Python (.py) file.
- '.github/workflows/lint.yml' # Run if pushed commits include a change to a github actions workflow file.
- 'requirements.txt' # Run if pushed commits include a change to the Python requirements.txt file.
- '.ruff.toml' # Run if ruff configuration file changes.
- '.pyprogject.toml' # Run if project configuration file changes.
workflow_dispatch:

jobs:
Expand Down
48 changes: 0 additions & 48 deletions .ruff.toml

This file was deleted.

21 changes: 17 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,24 @@ Changelog = "https://github.com/andrew-codechimp/HA-Hive-Local-Thermostat/releas
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core"]

[tool.ruff]
[tool.lint.ruff]
ignore = [
"ANN101", # Self... explanatory
"ANN401", # Opiniated warning on disallowing dynamically typed expressions
"D203", # Conflicts with other rules
"D213", # Conflicts with other rules
"TID252", # Relative imports
"RUF012", # Just broken
"D202", # No blank lines allowed after function docstring
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D404", # First word of the docstring should not be This
"D406", # Section name should end with a newline
"D407", # Section name underlining
"D411", # Missing blank line before section
"E501", # line too long
"E731", # do not assign a lambda expression, use a def


# Formatter conflicts
"COM812",
Expand All @@ -62,15 +72,15 @@ ignore = [
select = ["ALL"]
src = ["custom_components/hive_local_thermostat"]

[tool.ruff.flake8-import-conventions.extend-aliases]
[tool.link.flake8-import-conventions.extend-aliases]
"homeassistant.helpers.area_registry" = "ar"
"homeassistant.helpers.config_validation" = "cv"
"homeassistant.helpers.device_registry" = "dr"
"homeassistant.helpers.entity_registry" = "er"
"homeassistant.helpers.issue_registry" = "ir"
voluptuous = "vol"

[tool.ruff.isort]
[tool.lint.isort]
force-sort-within-sections = true
known-first-party = ["homeassistant"]
combine-as-imports = true
Expand Down Expand Up @@ -106,7 +116,7 @@ check_untyped_defs = true
disallow_any_generics = true
# disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
# disallow_untyped_calls = true
disallow_untyped_decorators = true
# disallow_untyped_defs = true
no_implicit_optional = true
Expand All @@ -117,3 +127,6 @@ warn_redundant_casts = true
warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true

[tool.ruff.lint.mccabe]
max-complexity = 25

0 comments on commit e060009

Please sign in to comment.