From b7cb01632ce15b99b65ae7685baf2d19cd7f69fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=BCller?= Date: Fri, 19 Jul 2024 16:51:21 +0200 Subject: [PATCH] pre-commit: initial version --- .gitignore | 2 ++ .pre-commit-config.yaml | 29 +++++++++++++++++++++++++++++ .spellcheck-en-custom.txt | 15 +++++++++++++++ .spellcheck.yml | 28 ++++++++++++++++++++++++++++ .yamllint | 7 +++++++ 5 files changed, 81 insertions(+) create mode 100644 .pre-commit-config.yaml create mode 100644 .spellcheck-en-custom.txt create mode 100644 .spellcheck.yml create mode 100644 .yamllint diff --git a/.gitignore b/.gitignore index a5041767..e5094d65 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ cov-int/ /docs/osbuild.1 /docs/osbuild-manifest.5 + +dictionary.dic diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..b1259a8f --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,29 @@ +# 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: v4.6.0 + hooks: + - id: trailing-whitespace + exclude: ".*\\.md$" + - id: end-of-file-fixer + exclude: "manifest-db/.*\\.json$" + - id: check-yaml + - id: check-json + files: "Schutzfile|.*\\.json" + types: [] + - id: check-added-large-files + - repo: https://github.com/adrienverge/yamllint + rev: v1.35.1 + hooks: + - id: yamllint + args: [--strict] + - repo: https://github.com/schuellerf/pre-commit-pyspelling + rev: 0.1.0 + hooks: + - id: pyspelling + args: ["--config", ".spellcheck.yml"] + - repo: https://github.com/hhatto/autopep8 + rev: v2.3.0 + hooks: + - id: autopep8 diff --git a/.spellcheck-en-custom.txt b/.spellcheck-en-custom.txt new file mode 100644 index 00000000..45e11d4f --- /dev/null +++ b/.spellcheck-en-custom.txt @@ -0,0 +1,15 @@ +DB's +discoverable +distros +GH +Github +Gitlab +JSON +osbuild +OSbuild +ppc +repo +rhel +Schutzbot +th +toolchain diff --git a/.spellcheck.yml b/.spellcheck.yml new file mode 100644 index 00000000..4764e17b --- /dev/null +++ b/.spellcheck.yml @@ -0,0 +1,28 @@ +# SPDX-License-Identifier: Apache-2.0 + +matrix: + - name: markdown + aspell: + lang: en + d: en_US + camel-case: true + mode: markdown + sources: + - "**/*.md|!venv/**" + dictionary: + wordlists: + - .spellcheck-en-custom.txt + pipeline: + - pyspelling.filters.context: + context_visible_first: true + escapes: '\\[\\`~]' + delimiters: + # Ignore multiline content between fences (fences can have 3 or more back ticks) + # ```language + # content + # ``` + - open: '^(?P *`{3,}).*$' + close: '^(?P=open)$' + # Ignore text between inline back ticks + - open: '(?P`+)' + close: '(?P=open)' diff --git a/.yamllint b/.yamllint new file mode 100644 index 00000000..3f1bbe3a --- /dev/null +++ b/.yamllint @@ -0,0 +1,7 @@ +--- +extends: default + +rules: + document-start: disable + line-length: + max: 120