From f08271326d0b302cd14d23029d8baab5c92fdf90 Mon Sep 17 00:00:00 2001 From: Charles-Edouard de la Vergne Date: Mon, 8 Jan 2024 19:12:31 +0100 Subject: [PATCH] Add pre-commit config --- .mdl.rb | 11 ++++++++ .mdlrc | 11 ++++++++ .pre-commit-config.yaml | 58 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 .mdl.rb create mode 100644 .mdlrc create mode 100644 .pre-commit-config.yaml diff --git a/.mdl.rb b/.mdl.rb new file mode 100644 index 0000000..0b971f6 --- /dev/null +++ b/.mdl.rb @@ -0,0 +1,11 @@ +# Style file for mdl +# https://github.com/markdownlint/markdownlint/blob/main/docs/creating_styles.md + +# Include all rules +all + +# Disable specific rules +#exclude_rule 'MD012' + +# Update rules configuration +rule 'MD013', :line_length => 120 diff --git a/.mdlrc b/.mdlrc new file mode 100644 index 0000000..4d04c4d --- /dev/null +++ b/.mdlrc @@ -0,0 +1,11 @@ +# markdownlint config file + +# Use custom style file +style "#{File.dirname(__FILE__)}/.mdl.rb" + +# MD005 - Inconsistent indentation for list items at the same level +# MD007 - Unordered list indentation +# MD014 - Dollar signs used before commands without showing output +# MD024 - Multiple headers with the same content +# MD041 - First line in file should be a top level header +rules "~MD005,~MD007,~MD014,~MD024,~MD041" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..f79567a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,58 @@ +# To install hooks, run: +# pre-commit install --hook-type pre-commit +# pre-commit install --hook-type commit-msg + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: mixed-line-ending + - id: check-added-large-files + - id: check-merge-conflict + - id: check-case-conflict + + - repo: https://github.com/codespell-project/codespell + rev: v2.2.5 + hooks: + - id: codespell + args: ['--ignore-words-list', 'ontop'] + + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v11.0.1 + hooks: + - id: clang-format + types_or: [c] + + - repo: https://github.com/Mateusz-Grzelinski/actionlint-py + rev: v1.6.26.11 + hooks: + - id: actionlint + types_or: [yaml] + + - repo: https://github.com/markdownlint/markdownlint + rev: v0.13.0 + hooks: + - id: markdownlint + types_or: [markdown] + + - repo: local + hooks: + + # Python scripts + - id: pylint + name: Check python Client + # Only display messages, no score, disable few errors + entry: pylint -j 0 --rc tests/setup.cfg + language: system + types: [python] + files: '^tests\/.*$' + + - id: pylint + name: Check python Tool + # Only display messages, no score, disable few errors + entry: pylint -j 0 --rc pytools/setup.cfg + language: system + types: [python] + files: '^pytools\/.*$'