From 9f2ebcba6d70eaf40a8efa384f5e6c739e458c02 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Sun, 23 Nov 2025 18:06:51 +0100 Subject: [PATCH] WIP: Add a pre-commit hook and a checker to the ci Signed-off-by: Nikolai Rodionov --- .pre-commit-config.yaml | 12 ++++++++++++ .woodpecker/{tests.yaml => code_tests.yaml} | 7 ++----- .woodpecker/pre_commit_test.yaml | 8 ++++++++ LICENSE | 18 +++++++++--------- README.md | 1 - 5 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 .pre-commit-config.yaml rename .woodpecker/{tests.yaml => code_tests.yaml} (81%) create mode 100644 .woodpecker/pre_commit_test.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..6eef1a7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-added-large-files + - id: check-merge-conflict + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/codespell-project/codespell + rev: v2.4.1 + hooks: + - id: codespell diff --git a/.woodpecker/tests.yaml b/.woodpecker/code_tests.yaml similarity index 81% rename from .woodpecker/tests.yaml rename to .woodpecker/code_tests.yaml index adeea57..aa991da 100644 --- a/.woodpecker/tests.yaml +++ b/.woodpecker/code_tests.yaml @@ -1,16 +1,13 @@ when: event: - push - steps: - clippy: + - name: Clippy linter image: rust:1.91.1-bullseye commands: - rustup component add clippy - cargo clippy - - test: + - name: Unit tests image: rust:1.91.1-bullseye commands: - cargo test - diff --git a/.woodpecker/pre_commit_test.yaml b/.woodpecker/pre_commit_test.yaml new file mode 100644 index 0000000..ec22414 --- /dev/null +++ b/.woodpecker/pre_commit_test.yaml @@ -0,0 +1,8 @@ +when: + event: + - push +steps: + - name: Pre commit validation + image: codeberg.org/sp1thas/woodpecker-ci-pre-commit-runner + settings: + args: "--all-files" diff --git a/LICENSE b/LICENSE index 3aa532f..2e113f1 100644 --- a/LICENSE +++ b/LICENSE @@ -2,17 +2,17 @@ MIT License Copyright (c) 2025 badhouseplants -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT -LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO -EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO +EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 75878aa..1ce0e3f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ # termix -