From e15ddc5b483ddcabec22e62c28bea14be063642f Mon Sep 17 00:00:00 2001 From: Liora Milbaum Date: Wed, 8 Nov 2023 15:41:55 +0200 Subject: [PATCH] enable pre-commit --- .github/workflows/build-and-push-image.yml | 2 +- .github/workflows/pre-commit.yml | 15 +++++++++++ .pre-commit-config.yaml | 31 ++++++++++++++++++++++ README.md | 13 ++++++++- 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/build-and-push-image.yml b/.github/workflows/build-and-push-image.yml index e1a1d16..cd45e31 100644 --- a/.github/workflows/build-and-push-image.yml +++ b/.github/workflows/build-and-push-image.yml @@ -2,7 +2,7 @@ name: build-and-push-image on: push: - branches: + branches: - main pull_request: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..28aae5f --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,15 @@ +--- +name: pre_commit + +on: # yamllint disable-line rule:truthy + pull_request: + branches: + - main + +jobs: + pre_commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1 + - uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507 # v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..9ee9ce3 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,31 @@ +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace + args: + - --markdown-linebreak-ext=md + - id: check-docstring-first + - id: requirements-txt-fixer + - id: check-merge-conflict + - id: no-commit-to-branch + args: + - "--branch" + - "main" + - id: check-symlinks + - id: detect-private-key + - id: detect-aws-credentials + args: + - --allow-missing-credentials + - id: check-json + - id: check-yaml + - repo: https://github.com/markdownlint/markdownlint + rev: v0.13.0 + hooks: + - id: markdownlint + - repo: https://github.com/maxbrunet/pre-commit-renovate + rev: 37.49.5 + hooks: + - id: renovate-config-validator diff --git a/README.md b/README.md index e9e8db1..aa4bb5a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,15 @@ # centos-boot-dev -Development images for [centos-boot](https://github.com/CentOS/sagano). +Development images for [centos-boot](https://github.com/CentOS/centos-boot). +## Badges + +| Badge | Description | Service | +| ----------------------- | -------------------- | ------------ | +| [![Renovate][1]][2] | Dependencies | Renovate | +| [![Pre-commit][3]][4] | Static quality gates | pre-commit | + +[1]: https://img.shields.io/badge/renovate-enabled-brightgreen?logo=renovate +[2]: https://renovatebot.com +[3]: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit +[4]: https://pre-commit.com/