Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update and fix pre-commit checks #259

Merged
merged 6 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ name: Commitlint
jobs:
lint:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v1
- uses: actions/checkout@v4
- uses: wagoid/commitlint-github-action@v5
20 changes: 8 additions & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
stage_test: &stage_test 'test'
# `image`
image_commitlint: &image_commitlint 'myii/ssf-commitlint:11'
image_dindruby: &image_dindruby 'myii/ssf-dind-ruby:2.7.1-r3'
image_dindrubybionic: &image_dindrubybionic 'myii/ssf-dind-ruby-bionic:2.7.5-1bbox1'
image_precommit: &image_precommit
name: 'myii/ssf-pre-commit:2.9.2'
entrypoint: ['/bin/bash', '-c']
image_dindruby: &image_dindruby
'dafyddj/ci-dind-python-ruby:2.0.0'
image_dindrubybionic: &image_dindrubybionic
'dafyddj/ci-dind-python-ruby:2.0.0'
image_precommit: &image_precommit 'dafyddj/ci-pre-commit:2.0.2'
image_rubocop: &image_rubocop 'pipelinecomponents/rubocop:latest'
image_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release:15.14'
# `services`
Expand Down Expand Up @@ -139,10 +139,8 @@ rubocop:
- 'export CONVERTED=test-the-use_this_template-button'
- 'git clone . /tmp/"${CONVERTED}"-formula'
- 'cd /tmp/"${CONVERTED}"-formula'
# Limit the version of `node` used by `pre-commit`, to avoid the following error:
# .../bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found
- 'echo "default_language_version:" >> .pre-commit-config.yaml'
- 'echo " node: 16.14.2" >> .pre-commit-config.yaml'
- 'git config user.email "test@example.com"'
- 'git config user.name "Test Name"'
# Install `pre-commit` hooks
- 'bin/install-hooks'
# Run the conversion script with debug output
Expand All @@ -153,9 +151,7 @@ rubocop:
# TODO: This should work from the env vars above automatically
- 'bundle config set path "${BUNDLE_CACHE_PATH}"'
- 'bundle config set without "${BUNDLE_WITHOUT}"'
- 'bundle update --bundler --conservative'
- 'bundle binstubs bundler --force'
- 'PATH=./bin:"$PATH" bundle install'
- 'bundle install'
script:
- 'bin/kitchen verify default-debian-11-master-py3'
# REMOVEME>
Expand Down
17 changes: 7 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,24 @@ repos:
name: Check commit message using commitlint
description: Lint commit message against @commitlint/config-conventional rules
stages: [commit-msg]
additional_dependencies: ['@commitlint/config-conventional@8.3.4']
- id: commitlint-travis
stages: [manual]
additional_dependencies: ['@commitlint/config-conventional@8.3.4']
always_run: true
additional_dependencies: ['@commitlint/config-conventional@17.1.0']
- repo: https://github.com/rubocop-hq/rubocop
rev: v1.30.1
rev: v1.57.0
hooks:
- id: rubocop
name: Check Ruby files with rubocop
args: [--debug]
always_run: true
pass_filenames: false
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.8.0.4
rev: v0.9.0.6
hooks:
- id: shellcheck
name: Check shell scripts with shellcheck
files: ^.*\.(sh|bash|ksh)$
types: []
- repo: https://github.com/adrienverge/yamllint
rev: v1.26.3
rev: v1.32.0
hooks:
- id: yamllint
name: Check YAML syntax with yamllint
Expand All @@ -59,11 +55,12 @@ repos:
name: Check Salt files using salt-lint
files: ^.*\.(sls|jinja|j2|tmpl|tst)$
- repo: https://github.com/myint/rstcheck
rev: 3f929574
rev: v6.2.0
hooks:
- id: rstcheck
name: Check reST files using rstcheck
exclude: 'docs/CHANGELOG.rst'
additional_dependencies: [sphinx==7.2.6]
- repo: https://github.com/saltstack-formulas/mirrors-rst-lint
rev: v1.3.2
hooks:
Expand All @@ -76,4 +73,4 @@ repos:
docs/CONTRIBUTING_DOCS.rst|
docs/index.rst|
)$
additional_dependencies: [pygments==2.9.0]
additional_dependencies: [pygments==2.16.1]
4 changes: 3 additions & 1 deletion .rstcheck.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[rstcheck]
report=info
ignore_language=rst
ignore_messages=(Duplicate (ex|im)plicit target.*|Hyperlink target ".*" is not referenced\.$)
# salt['config.get']('roles') is misidentified as a Markdown link.
# Ignore for now, but perhaps try to submit a fix upstream in rstcheck
ignore_messages=(Duplicate (ex|im)plicit target.*|Hyperlink target ".*" is not referenced\.$|\(rst\) Link is formatted in Markdown style\.)
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ gem 'kitchen-docker', git: 'https://gitlab.com/saltstack-formulas/infrastructure

gem 'kitchen-inspec', '>= 2.5.0'
gem 'kitchen-salt', '>= 0.7.2'

# Avoid the error 'pkeys are immutable on OpenSSL 3.0'
gem 'net-ssh', '>= 7.0.0'
Loading