diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..98ded67a4d024869ef29beaeaa077f857c0da5ff --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,24 @@ +--- +stages: + - test + +pre-commit: + stage: test + image: adarnimrod/ci-images:pre-commit + variables: + XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache" + script: + - pre-commit run --all-files + cache: + paths: + - .cache/ + +bats: + stage: test + image: alpine + before_script: + - apk add --update bats git + - git config --global user.email "you@example.com" + - git config --global user.name "Your Name" + script: + - bats tests/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3dc103c001e6aff405be269e406f4bd31def0e0..e458a8ab7f189b45cad84201a9534a4ba615a4b0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,17 +1,39 @@ -- repo: https://github.com/pre-commit/pre-commit-hooks - sha: v0.9.1 +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks.git + rev: v3.4.0 hooks: - - id: check-added-large-files - - id: check-merge-conflict - - id: check-yaml -- repo: https://git.shore.co.il/nimrod/shell-pre-commit.git - sha: v0.5.4 + - id: check-added-large-files + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: check-symlinks + - id: check-yaml + - id: trailing-whitespace + + - repo: https://git.shore.co.il/nimrod/shell-pre-commit.git + rev: v0.6.0 hooks: - - id: shell-lint - files: &shellscripts '^merge-conflict$' - - id: shellcheck - files: *shellscripts -- repo: https://git.shore.co.il/nimrod/git-pre-commit.git - sha: v0.1.1 + - id: shell-lint + - id: shellcheck + + - repo: https://git.shore.co.il/nimrod/git-pre-commit.git + rev: v0.1.1 hooks: - - id: merge-conflict + - id: merge-conflict + + - repo: https://github.com/pre-commit/pre-commit.git + rev: v2.9.3 + hooks: + - id: validate_manifest + + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.25.0 + hooks: + - id: yamllint + + - repo: https://github.com/amperser/proselint.git + rev: 0.10.2 + hooks: + - id: proselint + types: [plain-text] + exclude: LICENSE diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 8a9223714581622ec9b9c7dc6e6a1016ebabea7f..a3f3c988456c7ed9c3f34eb31a6fe9c8e8615c6f 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -5,4 +5,4 @@ language: script entry: merge-conflict files: '$^' - always_run: True + always_run: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ab17cf65178afa23b3a62fcfe84ae761ee5a1804..0000000000000000000000000000000000000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -dist: trusty -sudo: false -group: beta -cache: - - pip - - directories: - - $HOME/.pre-commit - - $HOME/.cabal - - $HOME/.ghc - -matrix: - fast_finish: True - include: - - language: python - python: "3.6" - env: - PATH: "$HOME/.cabal/bin:$PATH" - addons: - apt: - packages: - - cabal-install - - ghc - install: - - cabal update && cabal install shellcheck - - pip install pre_commit | cat - - pre-commit install-hooks - script: - - pre-commit run --all-files - - language: shell - script: - bats -t tests/ - -notifications: - on_failure: never - email: false diff --git a/README.md b/README.md index d894ae94b4eabb7c75e88c8ec859894b3ea9d4db..c1b35fa77507482a6bce12a213969f991a7a344d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Git pre-commit hooks -[](https://travis-ci.org/adarnimrod/git-pre-commit) + [](https://git.shore.co.il/nimrod/git-pre-commit/-/commits/master) [Pre-commit](http://pre-commit.com/) Git related hooks. @@ -28,4 +27,4 @@ This software is licensed under the MIT license (see the `LICENSE.txt` file). Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my [website](https://www.shore.co.il/). Patches are welcome via [git send-email](http://git-scm.com/book/en/v2/Git-Commands-Email). The repository is -located at <https://git.shore.co.il/nimrod/>. +located at <https://git.shore.co.il/explore>. diff --git a/tests/merge-conflict.bats b/tests/merge-conflict.bats old mode 100755 new mode 100644 index bf17c34ec57edba520de75f06d1807e1e6fb2aaf..c4285e86998a258f527fbb5dba2062a657df05e0 --- a/tests/merge-conflict.bats +++ b/tests/merge-conflict.bats @@ -1,5 +1,3 @@ -#!/usr/bin/env bats - export PATH="$BATS_TEST_DIRNAME/../:$PATH" export repo="$BATS_TMPDIR/testrepo"