Skip to content

Commit 2ad34f4

Browse files
xbarradevarfima
andauthored
Configure ruff as linter and formatter. (os-climate#113)
Signed-off-by: Xavier Barrachina Civera <[email protected]> Co-authored-by: Arfima Dev <[email protected]>
1 parent 9da76a3 commit 2ad34f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1187
-760
lines changed

.flake8

Lines changed: 0 additions & 3 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ repos:
2727
rev: v4.6.0
2828
hooks:
2929
- id: check-added-large-files
30-
- id: check-ast
3130
- id: check-case-conflict
3231
- id: check-executables-have-shebangs
3332
- id: check-json
@@ -50,19 +49,14 @@ repos:
5049
- id: requirements-txt-fixer
5150
- id: trailing-whitespace
5251

53-
- repo: https://github.com/pre-commit/mirrors-prettier
54-
rev: v4.0.0-alpha.8
55-
hooks:
56-
- id: prettier
57-
args:
58-
['--no-error-on-unmatched-pattern', '--ignore-unknown']
59-
60-
# Lint: Markdown - Disabled as most rules aren't useful
61-
# - repo: https://github.com/igorshubovych/markdownlint-cli
62-
# rev: v0.39.0
63-
# hooks:
64-
# - id: markdownlint
65-
# args: ["--fix"]
52+
# yamllint disable rule:comments-indentation
53+
## Commenting until issue #94 is fixed
54+
# - repo: https://github.com/igorshubovych/markdownlint-cli
55+
# rev: v0.41.0
56+
# hooks:
57+
# - id: markdownlint
58+
# args: ["--fix"]
59+
# yamllint enable rule:comments-indentation
6660

6761
- repo: https://github.com/jorisroovers/gitlint
6862
rev: v0.19.1
@@ -80,38 +74,25 @@ repos:
8074
hooks:
8175
- id: shellcheck
8276

83-
- repo: https://github.com/pycqa/pydocstyle.git
84-
rev: 6.3.0
85-
hooks:
86-
- id: pydocstyle
87-
additional_dependencies: ["tomli"]
88-
8977
- repo: https://github.com/Mateusz-Grzelinski/actionlint-py
90-
rev: v1.7.0.14
78+
rev: v1.7.1.15
9179
hooks:
9280
- id: actionlint
9381

94-
- repo: https://github.com/pycqa/flake8
95-
rev: "7.0.0"
96-
hooks:
97-
- id: flake8
98-
additional_dependencies:
99-
- pep8-naming
100-
10182
- repo: https://github.com/adrienverge/yamllint.git
10283
rev: v1.35.1
10384
hooks:
10485
- id: yamllint
105-
args: [ "-d", "{rules: {line-length: {max: 120}}, ignore-from-file: [.gitignore],}", ]
86+
args:
87+
["-d", "{rules: {line-length: {max: 120}},
88+
ignore-from-file: [.gitignore],}"]
10689

10790
- repo: https://github.com/astral-sh/ruff-pre-commit
108-
rev: v0.4.5
91+
rev: v0.5.7
10992
hooks:
11093
- id: ruff
111-
files: ^(scripts|tests|custom_components)/.+\.py$
112-
args: [--fix, --exit-non-zero-on-fix]
94+
args: [--fix, --exit-non-zero-on-fix, --config=pyproject.toml]
11395
- id: ruff-format
114-
files: ^(scripts|tests|custom_components)/.+\.py$
11596

11697
- repo: https://github.com/pre-commit/mirrors-mypy
11798
rev: "v1.10.0"
@@ -121,22 +102,17 @@ repos:
121102
args: ["--show-error-codes", "--install-types", "--non-interactive"]
122103
additional_dependencies: ["pytest", "types-requests"]
123104

105+
# yamllint disable rule:comments-indentation
124106
# Check for misspellings in documentation files
125107
# - repo: https://github.com/codespell-project/codespell
126108
# rev: v2.2.2
127109
# hooks:
128110
# - id: codespell
129111

130-
# To embrace black styles, even in docs
131-
# - repo: https://github.com/asottile/blacken-docs
132-
# rev: v1.13.0
133-
# hooks:
134-
# - id: blacken-docs
135-
# additional_dependencies: [black]
136-
137112
# Automatically upgrade Python syntax for newer versions
138113
# - repo: https://github.com/asottile/pyupgrade
139114
# rev: v3.15.0
140115
# hooks:
141116
# - id: pyupgrade
142117
# args: ['--py37-plus']
118+
# yamllint enable rule:comments-indentation

.prettierignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.pydocstyle

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)