From b5c7465a7379ed6d223ae7a8d75ea89340e03280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Iranzo=20G=C3=B3mez?= Date: Tue, 5 Nov 2024 16:29:26 +0100 Subject: [PATCH] Add GHA configuration and folder placeholers --- .github/dependabot.yml | 22 +++++++ .github/labels.yml | 16 ++++++ .github/workflows/label.yml | 14 +++++ .github/workflows/pre-commit.yml | 27 +++++++++ .gitignore | 6 ++ .pre-commit-config.yaml | 98 ++++++++++++++++++++++++++++++++ doc/.placeholder | 0 tests/.placeholder | 0 8 files changed, 183 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/labels.yml create mode 100644 .github/workflows/label.yml create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .gitignore create mode 100644 .pre-commit-config.yaml create mode 100644 doc/.placeholder create mode 100644 tests/.placeholder diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..6cfda47 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,22 @@ +--- +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "pip" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" + + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: build + prefix-development: chore + include: scope diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 0000000..4324fff --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,16 @@ +--- +# Add 'repo' label to any root file changes +repo: + - ./* + +documentation: + - doc/**/* + +modules: + - modules/* + +fab: + - fab/* + +ci: + - tests/**/* diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 0000000..f60ed22 --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,14 @@ +--- +name: "Label PRs from globs" +on: + schedule: + - cron: "0 * * * *" + +jobs: + execute: + runs-on: ubuntu-latest + steps: + - uses: jpmcb/prow-github-actions@v1.1.2 + with: + jobs: 'pr-labeler' + github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..fb641df --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,27 @@ +--- +name: pre-commit + +on: + pull_request: + push: + branches: [master] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.4 + with: + fetch-depth: 0 + - uses: actions/setup-python@v2.2.2 + - uses: actions/cache@v2.1.5 + with: + path: | + ~/.cache/pre-commit + key: ${{ runner.os }}-precommit-${{ hashFiles('**/.pre-commit-config.yaml/*') }} + restore-keys: | + ${{ runner.os }}-precommit- + + - uses: pre-commit/action@v2.0.3 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..65583be --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ + + + + + +node_modules/* diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..e52dfd0 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,98 @@ +--- +fail_fast: true +repos: + - hooks: + - id: commitizen + stages: + - commit-msg + repo: https://github.com/commitizen-tools/commitizen + rev: v3.30.0 + - hooks: + - id: check-useless-excludes + repo: meta + - hooks: + - files: \.(css|js|md|markdown|json) + id: prettier + repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + - hooks: + - id: black + repo: https://github.com/python/black + rev: 24.10.0 + - hooks: + - id: check-added-large-files + args: [--maxkb=10000] + - id: check-ast + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-json + - id: check-merge-conflict + - id: check-symlinks + - id: check-vcs-permalinks + - id: debug-statements + - id: check-xml + - args: + - --unsafe + id: check-yaml + - id: end-of-file-fixer + - id: forbid-new-submodules + - args: + - --branch + - gh-pages + id: no-commit-to-branch + - id: requirements-txt-fixer + - id: sort-simple-yaml + - id: trailing-whitespace + - id: mixed-line-ending + - id: detect-private-key + - id: check-byte-order-marker + - id: check-docstring-first + repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + - repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.7.2 + hooks: + # Run the linter. + - id: ruff + args: + - --fix + # Run the formatter. + - id: ruff-format + + - repo: https://github.com/scop/pre-commit-shfmt + rev: v3.10.0-1 + hooks: + # Choose one of: + - id: shfmt # native (requires/installs Go to build) + args: + - -w + - -i + - "4" + - -s + types: + - shell + + - hooks: + - id: blacken-docs + repo: https://github.com/asottile/blacken-docs + rev: 1.19.1 + + # - repo: https://github.com/asottile/pyupgrade + # rev: v2.38.0 + # hooks: + # - id: pyupgrade + # args: [--py39-plus] + + - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt + rev: 0.2.3 # or other specific tag + hooks: + - id: yamlfmt + args: [--mapping, "2", --sequence, "4", --offset, "2", "--preserve-quotes"] + + # - repo: https://github.com/hcodes/yaspeller.git + # rev: v10.0.1 + # hooks: + # - id: yaspeller + # types: + # - markdown diff --git a/doc/.placeholder b/doc/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/tests/.placeholder b/tests/.placeholder new file mode 100644 index 0000000..e69de29