Skip to content

Commit 7a1625c

Browse files
authored
Add more lint configuration (#495)
1 parent d02e0ed commit 7a1625c

File tree

6 files changed

+145
-7
lines changed

6 files changed

+145
-7
lines changed

.pre-commit-config.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
# See https://pre-commit.com for more information
3+
# See https://pre-commit.com/hooks.html for more hooks
4+
5+
repos:
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v5.0.0
8+
hooks:
9+
- id: check-added-large-files
10+
- id: check-ast
11+
- id: check-builtin-literals
12+
- id: check-docstring-first
13+
- id: check-executables-have-shebangs
14+
- id: check-merge-conflict
15+
- id: check-symlinks
16+
- id: check-json
17+
- id: check-toml
18+
- id: check-yaml
19+
- id: debug-statements
20+
- id: end-of-file-fixer
21+
- id: mixed-line-ending
22+
- id: name-tests-test
23+
- id: requirements-txt-fixer
24+
- id: trailing-whitespace
25+
- repo: https://github.com/astral-sh/ruff-pre-commit
26+
rev: v0.11.2 # ruff version
27+
hooks:
28+
- id: ruff # linter
29+
args: ["--fix"]
30+
- id: ruff-format # formatter
31+
- repo: https://github.com/asottile/pyupgrade
32+
rev: v3.19.1
33+
hooks:
34+
- id: pyupgrade
35+
args: ["--py310-plus"]
36+
- repo: https://github.com/shellcheck-py/shellcheck-py
37+
rev: v0.10.0.1
38+
hooks:
39+
- id: shellcheck
40+
- repo: https://github.com/google/yamlfmt
41+
rev: v0.16.0
42+
hooks:
43+
- id: yamlfmt
44+
- repo: https://github.com/adrienverge/yamllint
45+
rev: v1.36.2
46+
hooks:
47+
- id: yamllint
48+
- repo: https://github.com/pre-commit/mirrors-clang-format
49+
rev: v18.1.3 # clang-format version
50+
hooks:
51+
- id: clang-format
52+
- repo: https://github.com/cpplint/cpplint
53+
rev: 2.0.0
54+
hooks:
55+
- id: cpplint

.pylintrc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[FORMAT]
2+
indent-string=' '
3+
max-line-length=120
4+
5+
[BASIC]
6+
variable-rgx=(?:(?P<snake>[a-z_]+))
7+
8+
[TYPECHECK]
9+
generated-members=RdBu
10+
11+
[DESIGN]
12+
max-args=10
13+
max-locals=40
14+
15+
[MESSAGES CONTROL]
16+
disable=
17+
useless-suppression,
18+
too-few-public-methods,
19+
too-many-arguments,
20+
too-many-branches,
21+
too-many-instance-attributes,
22+
too-many-lines,
23+
too-many-locals,
24+
too-many-nested-blocks,
25+
too-many-positional-arguments,
26+
too-many-public-methods,
27+
too-many-return-statements,
28+
too-many-statements
29+
30+
[MISCELLANEOUS]
31+
notes=FIXME,XXX
32+
33+
[IMPORTS]
34+
ignored-modules=ROOT,yaml,pandas,numpy,shap,uproot

.yamlfmt.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
# yamlfmt configuration
3+
# Reference: https://github.com/google/yamlfmt/blob/main/docs/config-file.md#configuration-1
4+
5+
formatter:
6+
type: basic
7+
indent: 2
8+
include_document_start: true
9+
line_ending: lf
10+
retain_line_breaks_single: true
11+
max_line_length: -1
12+
drop_merge_tag: true
13+
pad_line_comments: 1
14+
trim_trailing_whitespace: true
15+
eof_newline: true

.yamllint.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
# yamllint configuration
3+
# Reference: https://yamllint.readthedocs.io/en/stable/rules.html
4+
5+
extends: default
6+
rules:
7+
line-length:
8+
max: 120
9+
level: warning
10+
indentation:
11+
spaces: 2
12+
level: warning
13+
comments:
14+
require-starting-space: true
15+
min-spaces-from-content: 1

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Run 3 validation framework
22

3-
[![GitHub MegaLinter](https://github.com/AliceO2Group/Run3Analysisvalidation/workflows/MegaLinter/badge.svg?branch=master)](https://github.com/marketplace/actions/megalinter)
3+
[![MegaLinter](https://github.com/AliceO2Group/Run3Analysisvalidation/workflows/MegaLinter/badge.svg?branch=master)](https://github.com/AliceO2Group/Run3Analysisvalidation/actions?query=workflow%3AMegaLinter+branch%3Amaster)
4+
[![pre-commit.ci](https://results.pre-commit.ci/badge/github/AliceO2Group/Run3AnalysisValidation/master.svg)](https://results.pre-commit.ci/latest/github/AliceO2Group/Run3AnalysisValidation/master)
45

56
## Introduction
67

pyproject.toml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
1-
[tool.black]
2-
line-length = 120
3-
4-
[tool.isort]
5-
profile = "black"
6-
71
[tool.pyright]
82
reportMissingImports = false
93
reportUnboundVariable = false
104

115
[tool.ruff]
126
line-length = 120
7+
8+
[tool.ruff.lint]
9+
select = [ # defaults: ["E4", "E7", "E9", "F"], see https://docs.astral.sh/ruff/rules/
10+
"A", # flake8-builtins
11+
"ARG", # flake8-unused-arguments
12+
"B", # flake8-bugbear
13+
"C4", # flake8-comprehensions
14+
"E", # pycodestyle Error
15+
"F", # Pyflakes
16+
"FLY", # flynt
17+
"FURB", # refurb
18+
"I", # isort
19+
"NPY", # NumPy-specific rules
20+
"PD", # pandas-vet
21+
"PL", # Pylint
22+
"RUF", # Ruff-specific rules
23+
"SIM", # flake8-simplify
24+
"UP", # pyupgrade
25+
"W", # pycodestyle Warning
26+
]
27+
ignore = [
28+
"PD901", # pandas-df-variable-name
29+
"PLR09", # too-many-...
30+
]

0 commit comments

Comments
 (0)