Skip to content

Commit 9a5c24d

Browse files
committed
ci: update pre-commit config, add new hooks
1 parent 4098176 commit 9a5c24d

File tree

3 files changed

+275
-277
lines changed

3 files changed

+275
-277
lines changed

.pre-commit-config.yaml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,22 @@ repos:
88
- id: end-of-file-fixer
99
- id: check-yaml
1010
exclude: ^test_hass/configuration.yaml$
11+
- id: check-toml
1112
- id: debug-statements
12-
- repo: https://github.com/asottile/pyupgrade
13-
rev: v3.3.0
13+
- repo: https://github.com/lsst-ts/pre-commit-xmllint
14+
rev: v1.0.0
1415
hooks:
15-
- id: pyupgrade
16-
args: [--py311-plus]
17-
- repo: https://github.com/psf/black
18-
rev: "22.10.0"
16+
- id: format-xmllint
17+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
18+
rev: v2.12.0
1919
hooks:
20-
- id: black
20+
- id: pretty-format-toml
21+
args: ["--autofix", "--no-sort"]
22+
- repo: https://github.com/abravalheri/validate-pyproject
23+
rev: v0.16
24+
hooks:
25+
- id: validate-pyproject
26+
additional_dependencies: ["validate-pyproject-schema-store[all]"]
2127
- repo: https://github.com/pre-commit/mirrors-mypy
2228
rev: "v1.4.1"
2329
hooks:
@@ -30,6 +36,10 @@ repos:
3036
types-PyYAML,
3137
types-requests,
3238
]
39+
- repo: https://github.com/psf/black
40+
rev: "22.10.0"
41+
hooks:
42+
- id: black
3343
- repo: https://github.com/astral-sh/ruff-pre-commit
3444
# Ruff version.
3545
rev: v0.0.278

pyproject.toml

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name = "homeassistant.sensor.feedparser"
33
version = "0.1.11"
44
description = "Home Assistant custom integration to parse RSS feeds"
55
maintainers = [
6-
{ name = "Ian Richardson", email = "[email protected]" },
7-
{ name = "Ondrej Gajdusek", email = "[email protected]" },
6+
{name = "Ian Richardson", email = "[email protected]"},
7+
{name = "Ondrej Gajdusek", email = "[email protected]"}
88
]
99
keywords = [
1010
"homeassistant",
@@ -13,22 +13,22 @@ keywords = [
1313
"feed",
1414
"parser",
1515
"custom-component",
16-
"custom-integration",
16+
"custom-integration"
1717
]
1818
classifiers = [
1919
"Intended Audience :: End Users/Desktop",
2020
"Intended Audience :: Developers",
2121
"License :: OSI Approved :: MIT License",
2222
"Operating System :: OS Independent",
23-
"Programming Language :: Python :: 3.11",
23+
"Programming Language :: Python :: 3.11"
2424
]
2525
requires-python = ">=3.11.0"
2626
dependencies = [
2727
"feedparser==6.0.11",
2828
"homeassistant",
2929
"python-dateutil",
3030
"requests-file",
31-
"requests",
31+
"requests"
3232
]
3333

3434
[project.optional-dependencies]
@@ -44,8 +44,8 @@ dev = [
4444
"voluptuous-stubs",
4545
"pyyaml",
4646
"bumpver"
47-
4847
]
48+
4949
[project.urls]
5050
"Source Code" = "https://github.com/custom-components/feedparser"
5151
"Bug Reports" = "https://github.com/custom-components/feedparser/issues"
@@ -100,22 +100,19 @@ select = [
100100
"SLF",
101101
"TCH",
102102
"TRY",
103-
"UP",
103+
"UP"
104104
]
105-
106105
# Q000,ANN,PT009,D,E501,
107106
ignore = [
108-
"D107", # Missing docstring in __init__
109-
"FBT001", # Boolean positional arg in function definition
110-
"D203", # 1 blank line required before class docstring
111-
"D213", # Multi-line docstring summary should start at the first line
112-
"FBT001", # Boolean positional argument in function definition
107+
"D107", # Missing docstring in __init__
108+
"FBT001", # Boolean positional arg in function definition
109+
"D203", # 1 blank line required before class docstring
110+
"D213", # Multi-line docstring summary should start at the first line
111+
"FBT001" # Boolean positional argument in function definition
113112
]
114-
115113
# Allow autofix for all enabled rules (when `--fix`) is provided.
116114
fixable = ["ALL"]
117115
unfixable = []
118-
119116
# Exclude a variety of commonly ignored directories.
120117
exclude = [
121118
".bzr",
@@ -134,15 +131,12 @@ exclude = [
134131
"buck-out",
135132
"build",
136133
"dist",
137-
"venv",
134+
"venv"
138135
]
139-
140136
# Same as Black.
141137
line-length = 88
142-
143138
# Allow unused variables when underscore-prefixed.
144139
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
145-
146140
# Assume Python 3.11.
147141
target-version = "py311"
148142

@@ -176,13 +170,6 @@ tag = true
176170
push = true
177171

178172
[tool.bumpver.file_patterns]
179-
"pyproject.toml" = [
180-
'current_version = "{version}"',
181-
'version = "{version}"',
182-
]
183-
"custom_components/feedparser/manifest.json" = [
184-
'version": "{version}"',
185-
]
186-
"custom_components/feedparser/sensor.py" = [
187-
'__version__ = "{version}"',
188-
]
173+
"pyproject.toml" = ['current_version = "{version}"', 'version = "{version}"']
174+
"custom_components/feedparser/manifest.json" = ['version": "{version}"']
175+
"custom_components/feedparser/sensor.py" = ['__version__ = "{version}"']

0 commit comments

Comments
 (0)