Skip to content

Commit

Permalink
ci: update pre-commit config, add new hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
ogajduse committed Feb 25, 2024
1 parent 4098176 commit 9a5c24d
Show file tree
Hide file tree
Showing 3 changed files with 275 additions and 277 deletions.
24 changes: 17 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,22 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
exclude: ^test_hass/configuration.yaml$
- id: check-toml
- id: debug-statements
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.0
- repo: https://github.com/lsst-ts/pre-commit-xmllint
rev: v1.0.0
hooks:
- id: pyupgrade
args: [--py311-plus]
- repo: https://github.com/psf/black
rev: "22.10.0"
- id: format-xmllint
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.12.0
hooks:
- id: black
- id: pretty-format-toml
args: ["--autofix", "--no-sort"]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
hooks:
- id: validate-pyproject
additional_dependencies: ["validate-pyproject-schema-store[all]"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.4.1"
hooks:
Expand All @@ -30,6 +36,10 @@ repos:
types-PyYAML,
types-requests,
]
- repo: https://github.com/psf/black
rev: "22.10.0"
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.278
Expand Down
45 changes: 16 additions & 29 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name = "homeassistant.sensor.feedparser"
version = "0.1.11"
description = "Home Assistant custom integration to parse RSS feeds"
maintainers = [
{ name = "Ian Richardson", email = "[email protected]" },
{ name = "Ondrej Gajdusek", email = "[email protected]" },
{name = "Ian Richardson", email = "[email protected]"},
{name = "Ondrej Gajdusek", email = "[email protected]"}
]
keywords = [
"homeassistant",
Expand All @@ -13,22 +13,22 @@ keywords = [
"feed",
"parser",
"custom-component",
"custom-integration",
"custom-integration"
]
classifiers = [
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.11"
]
requires-python = ">=3.11.0"
dependencies = [
"feedparser==6.0.11",
"homeassistant",
"python-dateutil",
"requests-file",
"requests",
"requests"
]

[project.optional-dependencies]
Expand All @@ -44,8 +44,8 @@ dev = [
"voluptuous-stubs",
"pyyaml",
"bumpver"

]

[project.urls]
"Source Code" = "https://github.com/custom-components/feedparser"
"Bug Reports" = "https://github.com/custom-components/feedparser/issues"
Expand Down Expand Up @@ -100,22 +100,19 @@ select = [
"SLF",
"TCH",
"TRY",
"UP",
"UP"
]

# Q000,ANN,PT009,D,E501,
ignore = [
"D107", # Missing docstring in __init__
"FBT001", # Boolean positional arg in function definition
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the first line
"FBT001", # Boolean positional argument in function definition
"D107", # Missing docstring in __init__
"FBT001", # Boolean positional arg in function definition
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the first line
"FBT001" # Boolean positional argument in function definition
]

# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []

# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
Expand All @@ -134,15 +131,12 @@ exclude = [
"buck-out",
"build",
"dist",
"venv",
"venv"
]

# Same as Black.
line-length = 88

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

# Assume Python 3.11.
target-version = "py311"

Expand Down Expand Up @@ -176,13 +170,6 @@ tag = true
push = true

[tool.bumpver.file_patterns]
"pyproject.toml" = [
'current_version = "{version}"',
'version = "{version}"',
]
"custom_components/feedparser/manifest.json" = [
'version": "{version}"',
]
"custom_components/feedparser/sensor.py" = [
'__version__ = "{version}"',
]
"pyproject.toml" = ['current_version = "{version}"', 'version = "{version}"']
"custom_components/feedparser/manifest.json" = ['version": "{version}"']
"custom_components/feedparser/sensor.py" = ['__version__ = "{version}"']
Loading

0 comments on commit 9a5c24d

Please sign in to comment.