Skip to content

Commit

Permalink
ci(pre-commit): update hook for rubocop
Browse files Browse the repository at this point in the history
* Automated using myii/ssf-formula#290
  • Loading branch information
myii committed Feb 1, 2021
1 parent 22c647e commit 2c090c3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 89 deletions.
110 changes: 24 additions & 86 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,30 @@ variables:
###############################################################################
# `lint` stage: `commitlint` & `pre-commit`
###############################################################################
commitlint:
stage: *stage_lint
image: *image_commitlint
script:
# Add `upstream` remote to get access to `upstream/master`
- 'git remote add upstream
https://gitlab.com/saltstack-formulas/apache-formula.git'
- 'git fetch --all'
# Set default commit hashes for `--from` and `--to`
- 'export COMMITLINT_FROM="$(git merge-base upstream/master HEAD)"'
- 'export COMMITLINT_TO="${CI_COMMIT_SHA}"'
# `coqbot` adds a merge commit to test PRs on top of the latest commit in
# the repo; amend this merge commit message to avoid failure
- |
if [ "${GITLAB_USER_LOGIN}" = "coqbot" ] \
&& [ "${CI_COMMIT_BRANCH}" != "master" ]; then
git commit --amend -m \
'chore: reword coqbot merge commit message for commitlint'
export COMMITLINT_TO=HEAD
fi
# Run `commitlint`
- 'commitlint --from "${COMMITLINT_FROM}"
--to "${COMMITLINT_TO}"
--verbose'
# commitlint:
# stage: *stage_lint
# image: *image_commitlint
# script:
# # Add `upstream` remote to get access to `upstream/master`
# - 'git remote add upstream
# https://gitlab.com/saltstack-formulas/apache-formula.git'
# - 'git fetch --all'
# # Set default commit hashes for `--from` and `--to`
# - 'export COMMITLINT_FROM="$(git merge-base upstream/master HEAD)"'
# - 'export COMMITLINT_TO="${CI_COMMIT_SHA}"'
# # `coqbot` adds a merge commit to test PRs on top of the latest commit in
# # the repo; amend this merge commit message to avoid failure
# - |
# if [ "${GITLAB_USER_LOGIN}" = "coqbot" ] \
# && [ "${CI_COMMIT_BRANCH}" != "master" ]; then
# git commit --amend -m \
# 'chore: reword coqbot merge commit message for commitlint'
# export COMMITLINT_TO=HEAD
# fi
# # Run `commitlint`
# - 'commitlint --from "${COMMITLINT_FROM}"
# --to "${COMMITLINT_TO}"
# --verbose'

pre-commit:
stage: *stage_lint
Expand Down Expand Up @@ -123,68 +123,6 @@ rubocop:
## Define the rest of the matrix based on Kitchen testing
# Make sure the instances listed below match up with
# the `platforms` defined in `kitchen.yml`
# default-debian-10-master-py3: {extends: '.test_instance'}
modules-debian-10-master-py3: {extends: '.test_instance'}
# default-ubuntu-1804-master-py3: {extends: '.test_instance'}
# modules-ubuntu-1804-master-py3: {extends: '.test_instance'}
# default-centos-8-master-py3: {extends: '.test_instance'}
modules-centos-8-master-py3: {extends: '.test_instance'}
# default-fedora-31-master-py3: {extends: '.test_instance'}
modules-fedora-31-master-py3: {extends: '.test_instance'}
# default-opensuse-leap-151-master-py3: {extends: '.test_instance'}
modules-opensuse-leap-151-master-py3: {extends: '.test_instance'}
# https://community.letsencrypt.org/t/localhost-crt-does-not-exist-or-is-empty/103979
default-amazonlinux-2-master-py3: {extends: '.test_instance'}
# modules-amazonlinux-2-master-py3: {extends: '.test_instance'}
# default-debian-10-2019-2-py3: {extends: '.test_instance'}
# modules-debian-10-2019-2-py3: {extends: '.test_instance'}
# default-debian-9-2019-2-py3: {extends: '.test_instance'}
# modules-debian-9-2019-2-py3: {extends: '.test_instance'}
# default-ubuntu-1804-2019-2-py3: {extends: '.test_instance'}
modules-ubuntu-1804-2019-2-py3: {extends: '.test_instance'}
# default-centos-8-2019-2-py3: {extends: '.test_instance'}
# modules-centos-8-2019-2-py3: {extends: '.test_instance'}
# default-fedora-31-2019-2-py3: {extends: '.test_instance'}
# modules-fedora-31-2019-2-py3: {extends: '.test_instance'}
# default-opensuse-leap-151-2019-2-py3: {extends: '.test_instance'}
# modules-opensuse-leap-151-2019-2-py3: {extends: '.test_instance'}
# default-centos-7-2019-2-py2: {extends: '.test_instance'}
modules-centos-7-2019-2-py2: {extends: '.test_instance'}
# default-amazonlinux-2-2019-2-py3: {extends: '.test_instance'}
# modules-amazonlinux-2-2019-2-py3: {extends: '.test_instance'}
# default-arch-base-latest-2019-2-py2: {extends: '.test_instance'}
# modules-arch-base-latest-2019-2-py2: {extends: '.test_instance'}
# arch-arch-base-latest-2019-2-py2: {extends: '.test_instance'}
# default-fedora-30-2018-3-py3: {extends: '.test_instance'}
# modules-fedora-30-2018-3-py3: {extends: '.test_instance'}
# default-debian-9-2018-3-py2: {extends: '.test_instance'}
# modules-debian-9-2018-3-py2: {extends: '.test_instance'}
# default-ubuntu-1604-2018-3-py2: {extends: '.test_instance'}
# modules-ubuntu-1604-2018-3-py2: {extends: '.test_instance'}
# default-centos-7-2018-3-py2: {extends: '.test_instance'}
# modules-centos-7-2018-3-py2: {extends: '.test_instance'}
# default-opensuse-leap-151-2018-3-py2: {extends: '.test_instance'}
# modules-opensuse-leap-151-2018-3-py2: {extends: '.test_instance'}
# default-amazonlinux-1-2018-3-py2: {extends: '.test_instance'}
# modules-amazonlinux-1-2018-3-py2: {extends: '.test_instance'}
# default-arch-base-latest-2018-3-py2: {extends: '.test_instance'}
# modules-arch-base-latest-2018-3-py2: {extends: '.test_instance'}
# arch-arch-base-latest-2018-3-py2: {extends: '.test_instance'}
# default-debian-8-2017-7-py2: {extends: '.test_instance'}
# modules-debian-8-2017-7-py2: {extends: '.test_instance'}
# default-ubuntu-1604-2017-7-py2: {extends: '.test_instance'}
# modules-ubuntu-1604-2017-7-py2: {extends: '.test_instance'}
# default-centos-6-2017-7-py2: {extends: '.test_instance'}
# modules-centos-6-2017-7-py2: {extends: '.test_instance'}
# default-fedora-30-2017-7-py2: {extends: '.test_instance'}
# modules-fedora-30-2017-7-py2: {extends: '.test_instance'}
# default-opensuse-leap-151-2017-7-py2: {extends: '.test_instance'}
# modules-opensuse-leap-151-2017-7-py2: {extends: '.test_instance'}
# default-amazonlinux-1-2017-7-py2: {extends: '.test_instance'}
# modules-amazonlinux-1-2017-7-py2: {extends: '.test_instance'}
# default-arch-base-latest-2017-7-py2: {extends: '.test_instance'}
# modules-arch-base-latest-2017-7-py2: {extends: '.test_instance'}
arch-arch-base-latest-2017-7-py2: {extends: '.test_instance'}

###############################################################################
# `release` stage: `semantic-release`
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ repos:
stages: [manual]
additional_dependencies: ['@commitlint/[email protected]']
always_run: true
- repo: https://github.com/adithyabsk/mirrors-rubocop
rev: v0.91.0
- repo: https://github.com/rubocop-hq/rubocop
rev: v1.9.1
hooks:
- id: rubocop
name: Check Ruby files with rubocop
Expand All @@ -33,7 +33,7 @@ repos:
files: ^.*\.(sh|bash|ksh)$
types: []
args: []
- repo: https://github.com/adrienverge/yamllint.git
- repo: https://github.com/adrienverge/yamllint
rev: v1.23.0
hooks:
- id: yamllint
Expand Down
3 changes: 3 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
/docs/AUTHORS.rst @saltstack-formulas/ssf
/docs/CHANGELOG.rst @saltstack-formulas/ssf
/docs/TOFS_pattern.rst @saltstack-formulas/ssf
/*/_mapdata/ @saltstack-formulas/ssf
/*/libsaltcli.jinja @saltstack-formulas/ssf
/*/libtofs.jinja @saltstack-formulas/ssf
/test/integration/**/_mapdata_spec.rb @saltstack-formulas/ssf
/test/integration/**/libraries/system.rb @saltstack-formulas/ssf
/test/integration/**/inspec.yml @saltstack-formulas/ssf
/test/integration/**/README.md @saltstack-formulas/ssf
/.gitignore @saltstack-formulas/ssf
Expand Down

0 comments on commit 2c090c3

Please sign in to comment.