diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 000000000..0029bad68 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,2 @@ +[codespell] +ignore-words-list = aNULL,brose,doub,Udo,re-use,re-used diff --git a/.envrc b/.envrc index 8392d159f..3550a30f2 100644 --- a/.envrc +++ b/.envrc @@ -1 +1 @@ -use flake \ No newline at end of file +use flake diff --git a/.github/renovate.json b/.github/renovate.json index 670f4331d..607d94509 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -28,5 +28,8 @@ ], "ignoreDeps": [ "ghcr.io/matrixgpt/matrix-chatgpt-bot" - ] + ], + "pre-commit": { + "enabled": true + } } diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index 0f9abd338..eccdec3bd 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -7,9 +7,7 @@ --- name: Matrix CI -on: # yamllint disable-line rule:truthy - push: - pull_request: +on: [push, pull_request] # yamllint disable-line rule:truthy jobs: yamllint: @@ -30,3 +28,11 @@ jobs: uses: ansible-community/ansible-lint-action@v6.17.0 with: path: roles/custom + precommit: + name: Run pre-commit + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run pre-commit + uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml deleted file mode 100644 index 34b7a09bf..000000000 --- a/.github/workflows/reuse.yml +++ /dev/null @@ -1,20 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. -# -# SPDX-License-Identifier: CC0-1.0 ---- -name: REUSE Compliance Check - -on: [push, pull_request] # yamllint disable-line rule:truthy - -permissions: - contents: read - -jobs: - reuse-compliance-check: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: REUSE Compliance Check - uses: fsfe/reuse-action@v5 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..147b9f2aa --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,26 @@ +--- +default_install_hook_types: [pre-push] + +exclude: "LICENSES/" + +# See: https://pre-commit.com/hooks.html +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + # - id: check-executables-have-shebangs + - id: check-added-large-files + - id: check-case-conflict + - id: check-json + - id: check-toml + - id: trailing-whitespace + - id: end-of-file-fixer + - repo: https://github.com/codespell-project/codespell + rev: v2.4.1 + hooks: + - id: codespell + args: ["--skip=*.po,*.pot,i18n/"] + - repo: https://github.com/fsfe/reuse-tool # https://reuse.software/dev/#pre-commit-hook + rev: v5.0.2 + hooks: + - id: reuse diff --git a/REUSE.toml b/REUSE.toml index 076d318ff..ba7d641f7 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -13,10 +13,12 @@ path = [ "i18n/PUBLISHED_LANGUAGES", "i18n/requirements.txt", "roles/custom/**/*.repo", + ".codespellrc", ".editorconfig", ".envrc", ".gitattributes", ".gitignore", + ".pre-commit-config.yaml", ".yamllint", "ansible.cfg", "flake.lock", diff --git a/docs/configuring-playbook-bridge-mx-puppet-discord.md b/docs/configuring-playbook-bridge-mx-puppet-discord.md index 0e0957aed..7285e8971 100644 --- a/docs/configuring-playbook-bridge-mx-puppet-discord.md +++ b/docs/configuring-playbook-bridge-mx-puppet-discord.md @@ -10,7 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later # Setting up MX Puppet Discord bridging (optional) **Note**: bridging to [Discord](https://discordapp.com/) can also happen via the [matrix-appservice-discord](configuring-playbook-bridge-appservice-discord.md)and [mautrix-discord](configuring-playbook-bridge-mautrix-discord.md) bridges supported by the playbook. -- For using as a Bot we recommend the [Appservice Discord](configuring-playbook-bridge-appservice-discord.md), because it supports plumbing. +- For using as a Bot we recommend the [Appservice Discord](configuring-playbook-bridge-appservice-discord.md), because it supports plumbing. - For personal use with a discord account we recommend the [mautrix-discord](configuring-playbook-bridge-mautrix-discord.md) bridge, because it is the most fully-featured and stable of the 3 Discord bridges supported by the playbook. The playbook can install and configure [mx-puppet-discord](https://gitlab.com/mx-puppet/discord/mx-puppet-discord) for you. diff --git a/docs/configuring-playbook-livekit-jwt-service.md b/docs/configuring-playbook-livekit-jwt-service.md index f206c329a..eaf3be171 100644 --- a/docs/configuring-playbook-livekit-jwt-service.md +++ b/docs/configuring-playbook-livekit-jwt-service.md @@ -15,4 +15,4 @@ This is a helper component which is part of the [Matrix RTC stack](configuring-p Take a look at: - `roles/custom/matrix-livekit-jwt-service/defaults/main.yml` for some variables that you can customize via your `vars.yml` file -- `roles/custom/matrix-livekit-jwt-service/templates/env.j2` for the component's default configuration. \ No newline at end of file +- `roles/custom/matrix-livekit-jwt-service/templates/env.j2` for the component's default configuration. diff --git a/docs/configuring-playbook-livekit-server.md b/docs/configuring-playbook-livekit-server.md index afc514fc7..3579feb56 100644 --- a/docs/configuring-playbook-livekit-server.md +++ b/docs/configuring-playbook-livekit-server.md @@ -35,4 +35,4 @@ To ensure LiveKit Server functions correctly, the following firewall rules and p For some reason, LiveKit Server's TURN ports (`3479/udp` and `5350/tcp`) are not reachable over IPv6 regardless of whether you've [enabled IPv6](./configuring-ipv6.md) for your server. -It seems like LiveKit Server intentionally only listens on `udp4` and `tcp4` as seen [here](https://github.com/livekit/livekit/blob/154b4d26b769c68a03c096124094b97bf61a996f/pkg/service/turn.go#L128) and [here](https://github.com/livekit/livekit/blob/154b4d26b769c68a03c096124094b97bf61a996f/pkg/service/turn.go#L92). \ No newline at end of file +It seems like LiveKit Server intentionally only listens on `udp4` and `tcp4` as seen [here](https://github.com/livekit/livekit/blob/154b4d26b769c68a03c096124094b97bf61a996f/pkg/service/turn.go#L128) and [here](https://github.com/livekit/livekit/blob/154b4d26b769c68a03c096124094b97bf61a996f/pkg/service/turn.go#L92). diff --git a/docs/configuring-playbook-matrix-rtc.md b/docs/configuring-playbook-matrix-rtc.md index fae94f497..2b19996cf 100644 --- a/docs/configuring-playbook-matrix-rtc.md +++ b/docs/configuring-playbook-matrix-rtc.md @@ -56,4 +56,4 @@ The shortcut commands with the [`just` program](just.md) are also available: `ju Once installed, Matrix clients which support Element Call (like [Element Web](configuring-playbook-client-element-web.md) and Element X on mobile (iOS and Android)) will automatically use the Matrix RTC stack. -These clients typically embed the Element Call frontend UI within them, so installing [Element Call](configuring-playbook-element-call.md) is only necessary if you'd like to use it standalone - directly via a browser. \ No newline at end of file +These clients typically embed the Element Call frontend UI within them, so installing [Element Call](configuring-playbook-element-call.md) is only necessary if you'd like to use it standalone - directly via a browser. diff --git a/roles/custom/matrix-element-call/templates/labels.j2 b/roles/custom/matrix-element-call/templates/labels.j2 index 436c13882..eea628a53 100644 --- a/roles/custom/matrix-element-call/templates/labels.j2 +++ b/roles/custom/matrix-element-call/templates/labels.j2 @@ -48,4 +48,4 @@ traefik.http.routers.matrix-element-call.tls.certResolver={{ matrix_element_call {% endif %} -{{ matrix_element_call_container_labels_additional_labels }} \ No newline at end of file +{{ matrix_element_call_container_labels_additional_labels }} diff --git a/roles/custom/matrix-media-repo/templates/grafana/media-repo.json b/roles/custom/matrix-media-repo/templates/grafana/media-repo.json index b2c2eadfa..d3dca38c0 100644 --- a/roles/custom/matrix-media-repo/templates/grafana/media-repo.json +++ b/roles/custom/matrix-media-repo/templates/grafana/media-repo.json @@ -1300,4 +1300,4 @@ "uid": "xJUZ3xfmk", "version": 15, "weekStart": "" -} \ No newline at end of file +} diff --git a/roles/custom/matrix-prometheus-nginxlog-exporter/templates/grafana/nginx-proxy.json b/roles/custom/matrix-prometheus-nginxlog-exporter/templates/grafana/nginx-proxy.json index 395314fd7..960f8b354 100644 --- a/roles/custom/matrix-prometheus-nginxlog-exporter/templates/grafana/nginx-proxy.json +++ b/roles/custom/matrix-prometheus-nginxlog-exporter/templates/grafana/nginx-proxy.json @@ -1702,4 +1702,4 @@ "uid": "x2_jWNF4k", "version": 12, "weekStart": "" -} \ No newline at end of file +} diff --git a/roles/custom/matrix-prometheus-nginxlog-exporter/templates/nginx-proxy.json b/roles/custom/matrix-prometheus-nginxlog-exporter/templates/nginx-proxy.json index 395314fd7..960f8b354 100644 --- a/roles/custom/matrix-prometheus-nginxlog-exporter/templates/nginx-proxy.json +++ b/roles/custom/matrix-prometheus-nginxlog-exporter/templates/nginx-proxy.json @@ -1702,4 +1702,4 @@ "uid": "x2_jWNF4k", "version": 12, "weekStart": "" -} \ No newline at end of file +} diff --git a/roles/custom/matrix-synapse-usage-exporter/templates/grafana/synapse-usage-exporter.json b/roles/custom/matrix-synapse-usage-exporter/templates/grafana/synapse-usage-exporter.json index 23226919d..468c5b92f 100644 --- a/roles/custom/matrix-synapse-usage-exporter/templates/grafana/synapse-usage-exporter.json +++ b/roles/custom/matrix-synapse-usage-exporter/templates/grafana/synapse-usage-exporter.json @@ -2743,4 +2743,4 @@ "uid": "c84624d7-3935-4470-83c0-c10d1cee35ff", "version": 2, "weekStart": "" -} \ No newline at end of file +}