diff --git a/.mega-linter.yml b/.mega-linter.yml index b9e768deb2..f7e65d4aab 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -14,12 +14,14 @@ DISABLE_LINTERS: - BASH_EXEC - BASH_SHFMT - JSON_PRETTIER + - PYTHON_BLACK + - PYTHON_FLAKE8 + - PYTHON_ISORT - REPOSITORY_DEVSKIM - REPOSITORY_GRYPE - REPOSITORY_KICS - REPOSITORY_SECRETLINT - REPOSITORY_TRIVY - - YAML_YAMLLINT - YAML_PRETTIER - YAML_V8R DISABLE_ERRORS_LINTERS: # If errors are found by these linters, they will be considered as non blocking. @@ -34,5 +36,7 @@ FLAVOR_SUGGESTIONS: false # Don't show suggestions about different MegaLinter fl PYTHON_ISORT_CONFIG_FILE: pyproject.toml PYTHON_PYRIGHT_CONFIG_FILE: pyproject.toml PYTHON_RUFF_CONFIG_FILE: pyproject.toml -CPP_CPPLINT_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".cu", ".cuh", ".cxx", ".cxx.in", ".h", ".h++", ".hh", ".h.in", ".hpp", ".hxx", ".inc", ".inl", ".macro"] -CPP_CLANG_FORMAT_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".cu", ".cuh", ".cxx", ".cxx.in", ".h", ".h++", ".hh", ".h.in", ".hpp", ".hxx", ".inc", ".inl", ".macro"] +CPP_CPPLINT_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".cu", ".cuh", ".cxx", ".cxx.in", ".h", ".h++", ".hh", + ".h.in", ".hpp", ".hxx", ".inc", ".inl", ".macro"] +CPP_CLANG_FORMAT_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".cu", ".cuh", ".cxx", ".cxx.in", ".h", ".h++", + ".hh", ".h.in", ".hpp", ".hxx", ".inc", ".inl", ".macro"] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..a8457f3721 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,34 @@ +--- +# 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: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.9.2 # ruff version + hooks: + - id: ruff # linter + args: ["check", "--select", "I", "--fix"] + - id: ruff-format # formatter + - repo: https://github.com/asottile/pyupgrade + rev: v3.19.1 + hooks: + - id: pyupgrade + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.10.0.1 + hooks: + - id: shellcheck + - repo: https://github.com/google/yamlfmt + rev: v0.14.0 + hooks: + - id: yamlfmt + - repo: https://github.com/adrienverge/yamllint + rev: v1.35.1 + hooks: + - id: yamllint diff --git a/.yamlfmt.yml b/.yamlfmt.yml new file mode 100644 index 0000000000..4a00cbdac3 --- /dev/null +++ b/.yamlfmt.yml @@ -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: 120 + drop_merge_tag: true + pad_line_comments: 1 + trim_trailing_whitespace: true + eof_newline: true diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000000..d0af03420f --- /dev/null +++ b/.yamllint.yml @@ -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