From b3f7be71358f12efc217738233e421b3814ec66e Mon Sep 17 00:00:00 2001 From: Calin Cristian Andrei Date: Sun, 7 Aug 2022 11:58:47 +0000 Subject: [PATCH] describe the use of pre-commit hook in CONTRIBUTING.md --- .markdownlint.yaml | 1 + .pre-commit-config.yaml | 2 +- CONTRIBUTING.md | 17 ++++++++++++----- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 02907b2bc..8ece4c761 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,2 +1,3 @@ --- MD013: false +MD029: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 99989b5f9..28cf7a907 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: rev: v0.11.0 hooks: - id: markdownlint - args: [ -r, ~MD013 ] + args: [ -r, "~MD013,~MD029" ] exclude: "^.git" - repo: local diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a6ebdb22b..8b4aae9d5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,12 @@ pip install -r tests/requirements.txt #### Linting -Kubespray uses `yamllint` and `ansible-lint`. To run them locally use `yamllint .` and `ansible-lint`. It is a good idea to add call these tools as part of your pre-commit hook and avoid a lot of back end forth on fixing linting issues (). +Kubespray uses [pre-commit](https://pre-commit.com) hook configuration to run several linters, please install this tool and use it to run validation tests before submitting a PR. + +```ShellSession +pre-commit install +pre-commit run -a # To run pre-commit hook on all files in the repository, even if they were not modified +``` #### Molecule @@ -33,7 +38,9 @@ Vagrant with VirtualBox or libvirt driver helps you to quickly spin test cluster 1. Submit an issue describing your proposed change to the repo in question. 2. The [repo owners](OWNERS) will respond to your issue promptly. 3. Fork the desired repo, develop and test your code changes. -4. Sign the CNCF CLA () -5. Submit a pull request. -6. Work with the reviewers on their suggestions. -7. Ensure to rebase to the HEAD of your target branch and squash un-necessary commits () before final merger of your contribution. +4. Install [pre-commit](https://pre-commit.com) and install it in your development repo). +5. Addess any pre-commit validation failures. +6. Sign the CNCF CLA () +7. Submit a pull request. +8. Work with the reviewers on their suggestions. +9. Ensure to rebase to the HEAD of your target branch and squash un-necessary commits () before final merger of your contribution.