Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-builtin-literals
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-symlinks
- id: check-json
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: name-tests-test
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.2 # ruff version
hooks:
- id: ruff # linter
args: ["--fix"]
- id: ruff-format # formatter
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
args: ["--py310-plus"]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
- repo: https://github.com/google/yamlfmt
rev: v0.16.0
hooks:
- id: yamlfmt
- repo: https://github.com/adrienverge/yamllint
rev: v1.36.2
hooks:
- id: yamllint
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.3 # clang-format version
hooks:
- id: clang-format
- repo: https://github.com/cpplint/cpplint
rev: 2.0.0
hooks:
- id: cpplint
34 changes: 34 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[FORMAT]
indent-string=' '
max-line-length=120

[BASIC]
variable-rgx=(?:(?P<snake>[a-z_]+))

[TYPECHECK]
generated-members=RdBu

[DESIGN]
max-args=10
max-locals=40

[MESSAGES CONTROL]
disable=
useless-suppression,
too-few-public-methods,
too-many-arguments,
too-many-branches,
too-many-instance-attributes,
too-many-lines,
too-many-locals,
too-many-nested-blocks,
too-many-positional-arguments,
too-many-public-methods,
too-many-return-statements,
too-many-statements

[MISCELLANEOUS]
notes=FIXME,XXX

[IMPORTS]
ignored-modules=ROOT,yaml,pandas,numpy,shap,uproot
15 changes: 15 additions & 0 deletions .yamlfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# yamlfmt configuration
# Reference: https://github.com/google/yamlfmt/blob/main/docs/config-file.md#configuration-1

formatter:
type: basic
indent: 2
include_document_start: true
line_ending: lf
retain_line_breaks_single: true
max_line_length: -1
drop_merge_tag: true
pad_line_comments: 1
trim_trailing_whitespace: true
eof_newline: true
15 changes: 15 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# yamllint configuration
# Reference: https://yamllint.readthedocs.io/en/stable/rules.html

extends: default
rules:
line-length:
max: 120
level: warning
indentation:
spaces: 2
level: warning
comments:
require-starting-space: true
min-spaces-from-content: 1
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Run 3 validation framework

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

## Introduction

Expand Down
30 changes: 24 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
[tool.black]
line-length = 120

[tool.isort]
profile = "black"

[tool.pyright]
reportMissingImports = false
reportUnboundVariable = false

[tool.ruff]
line-length = 120

[tool.ruff.lint]
select = [ # defaults: ["E4", "E7", "E9", "F"], see https://docs.astral.sh/ruff/rules/
"A", # flake8-builtins
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"E", # pycodestyle Error
"F", # Pyflakes
"FLY", # flynt
"FURB", # refurb
"I", # isort
"NPY", # NumPy-specific rules
"PD", # pandas-vet
"PL", # Pylint
"RUF", # Ruff-specific rules
"SIM", # flake8-simplify
"UP", # pyupgrade
"W", # pycodestyle Warning
]
ignore = [
"PD901", # pandas-df-variable-name
"PLR09", # too-many-...
]