Skip to content

Commit 342d302

Browse files
committed
ci: linter configs
1 parent 7b0c64e commit 342d302

12 files changed

+203
-65
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ indent_size = 2
1313

1414
[*.yaml.j2]
1515
indent_size = 2
16+
17+
[Makefile]
18+
indent_style = tab

.ansible-lint .github/.ansible-lint.yml

+4
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@
55
skip_list:
66
- experimental
77

8+
exclude_paths:
9+
- ./contrib
10+
- ./.venv
11+
812
...

.github/.commitlint.config.mjs

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// More info: https://github.com/wayofdev/npm-shareable-configs/blob/master/packages/commitlint-config/src/index.js
2+
const automaticCommitPattern = /^chore\(release\):.*\[skip ci]/
3+
4+
export default {
5+
extends: ['@commitlint/config-conventional'],
6+
/*
7+
This resolves a linting conflict between commitlint's body-max-line-length
8+
due to @semantic-release/git putting release notes in the commit body
9+
https://github.com/semantic-release/git/issues/331
10+
*/
11+
ignores: [(commitMessage) => automaticCommitPattern.test(commitMessage)],
12+
rules: {
13+
'body-leading-blank': [1, 'always'],
14+
'body-max-line-length': [2, 'always', 120],
15+
'footer-leading-blank': [1, 'always'],
16+
'footer-max-line-length': [2, 'always', 120],
17+
'header-max-length': [2, 'always', 100],
18+
'scope-case': [2, 'always', 'lower-case'],
19+
'subject-case': [2, 'never', ['sentence-case', 'start-case', 'pascal-case', 'upper-case']],
20+
'subject-empty': [2, 'never'],
21+
'subject-full-stop': [2, 'never', '.'],
22+
'type-case': [2, 'always', 'lower-case'],
23+
'type-empty': [2, 'never'],
24+
'type-enum': [
25+
2,
26+
'always',
27+
[
28+
'feat', // New feature
29+
'fix', // Bug fix
30+
'perf', // Performance improvement
31+
'docs', // Documentation changes
32+
'style', // Code style update (formatting, missing semi colons, etc)
33+
'deps', // Dependency updates
34+
'refactor', // Code refactoring
35+
'ci', // Continuous integration changes
36+
'test', // Adding missing tests
37+
'revert', // Revert to a previous commit
38+
'build', // Changes that affect the build system
39+
'chore', // Other changes that don't modify src or test files
40+
'security', // Security improvements
41+
],
42+
],
43+
},
44+
}

.github/.cz.config.js

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// @see https://cz-git.qbb.sh/config/#configure-template
2+
module.exports = {
3+
alias: { fd: 'docs: fix typos' },
4+
messages: {
5+
type: 'Select the type of change that you\'re committing:',
6+
scope: 'Denote the SCOPE of this change (optional):',
7+
customScope: 'Denote the SCOPE of this change:',
8+
subject: 'Write a SHORT, IMPERATIVE tense description of the change:\n',
9+
body: 'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',
10+
breaking: 'List any BREAKING CHANGES (optional). Use "|" to break new line:\n',
11+
footerPrefixesSelect: 'Select the ISSUES type of changeList by this change (optional):',
12+
customFooterPrefix: 'Input ISSUES prefix:',
13+
footer: 'List any ISSUES by this change. E.g.: #31, #34:\n',
14+
generatingByAI: 'Generating your AI commit subject...',
15+
generatedSelectByAI: 'Select suitable subject by AI generated:',
16+
confirmCommit: 'Are you sure you want to proceed with the commit above?'
17+
},
18+
types: [
19+
{ value: 'feat', name: 'feat: A new feature', emoji: ':sparkles:' },
20+
{ value: 'fix', name: 'fix: A bug fix', emoji: ':bug:' },
21+
{ value: 'perf', name: 'perf: A code change that improves performance', emoji: ':zap:' },
22+
{ value: 'docs', name: 'docs: Documentation only changes', emoji: ':memo:' },
23+
{ value: 'style', name: 'style: Changes that do not affect the meaning of the code', emoji: ':lipstick:' },
24+
{ value: 'deps', name: 'deps: A dependency update', emoji: ':package:' },
25+
{ value: 'refactor', name: 'refactor: A code change that neither fixes a bug nor adds a feature', emoji: ':recycle:' },
26+
{ value: 'ci', name: 'ci: Changes to our CI configuration files and scripts', emoji: ':ferris_wheel:' },
27+
{ value: 'test', name: 'test: Adding missing tests or correcting existing tests', emoji: ':white_check_mark:' },
28+
{ value: 'revert', name: 'revert: Reverts a previous commit', emoji: ':rewind:' },
29+
{ value: 'build', name: 'build: Changes that affect the build system or external dependencies', emoji: ':package:' },
30+
{ value: 'chore', name: 'chore: Other changes that don\'t modify src or test files', emoji: ':hammer:' },
31+
{ value: 'security', name: 'security: A code change that fixes a security issue', emoji: ':lock:' }
32+
],
33+
useEmoji: false,
34+
emojiAlign: 'center',
35+
useAI: false,
36+
aiNumber: 1,
37+
themeColorCode: '',
38+
scopes: [],
39+
allowCustomScopes: true,
40+
allowEmptyScopes: true,
41+
customScopesAlign: 'bottom',
42+
customScopesAlias: 'custom',
43+
emptyScopesAlias: 'empty',
44+
upperCaseSubject: false,
45+
markBreakingChangeMode: false,
46+
allowBreakingChanges: ['feat', 'fix'],
47+
breaklineNumber: 100,
48+
breaklineChar: '|',
49+
skipQuestions: [],
50+
issuePrefixes: [{ value: 'closed', name: 'closed: ISSUES has been processed' }],
51+
customIssuePrefixAlign: 'top',
52+
emptyIssuePrefixAlias: 'skip',
53+
customIssuePrefixAlias: 'custom',
54+
allowCustomIssuePrefix: true,
55+
allowEmptyIssuePrefix: true,
56+
confirmColorize: true,
57+
maxHeaderLength: Infinity,
58+
maxSubjectLength: Infinity,
59+
minSubjectLength: 0,
60+
scopeOverrides: undefined,
61+
defaultBody: '',
62+
defaultIssues: '',
63+
defaultScope: '',
64+
defaultSubject: ''
65+
}

.github/.hadolint.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
3+
trustedRegistries:
4+
- docker.io
5+
- "*.gcr.io"
6+
7+
...

.github/.markdownlint.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json",
3+
"line-length": false,
4+
"no-inline-html": false,
5+
"first-line-h1": false,
6+
"no-duplicate-heading": false
7+
}

.github/.yamllint.yaml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
3+
extends: default
4+
5+
rules:
6+
braces:
7+
# Defaults
8+
# min-spaces-inside: 0
9+
# max-spaces-inside: 0
10+
11+
# Keep 0 min-spaces to not error on empty {} collection definitions
12+
min-spaces-inside: 0
13+
14+
# Allow one space inside braces to improve code readability
15+
max-spaces-inside: 1
16+
17+
brackets:
18+
# Defaults
19+
# min-spaces-inside: 0
20+
# max-spaces-inside: 0
21+
22+
# Keep 0 min-spaces to not error on empty [] collection definitions
23+
min-spaces-inside: 0
24+
25+
# Allow one space inside braces to improve code readability
26+
max-spaces-inside: 1
27+
28+
colons:
29+
# Defaults
30+
# min-spaces-before: 0
31+
# max-spaces-after: 1
32+
33+
# Allow multiple spaces after a colon to allow indentation of YAML
34+
# dictionary values
35+
max-spaces-after: -1
36+
37+
commas:
38+
# Defaults
39+
# max-spaces-after: 1
40+
41+
# Allow multiple spaces after a comma to allow indentation of YAML
42+
# dictionary values
43+
max-spaces-after: -1
44+
45+
comments:
46+
require-starting-space: true
47+
min-spaces-from-content: 1
48+
49+
comments-indentation: false
50+
51+
line-length: disable
52+
53+
octal-values:
54+
forbid-implicit-octal: true
55+
forbid-explicit-octal: true
56+
57+
...

.pre-commit-config.yaml

+16-7
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,48 @@
22

33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.4.0
5+
rev: v4.6.0
66
hooks:
77
- id: trailing-whitespace
88
- id: end-of-file-fixer
99
- id: fix-encoding-pragma
10+
- id: check-added-large-files
11+
args: ['--maxkb=600']
1012

1113
- repo: https://github.com/adrienverge/yamllint
12-
rev: v1.32.0
14+
rev: v1.35.1
1315
hooks:
1416
- id: yamllint
1517
files: \.(yaml|yml)$
1618
types: [file, yaml]
17-
entry: yamllint --strict
19+
entry: yamllint -c .github/.yamllint.yaml --strict
1820

1921
- repo: https://github.com/commitizen-tools/commitizen
20-
rev: 3.5.2
22+
rev: v3.29.0
2123
hooks:
2224
- id: commitizen
2325
stages:
2426
- commit-msg
2527

28+
- repo: https://github.com/mpalmer/action-validator
29+
rev: v0.6.0
30+
hooks:
31+
- id: action-validator
32+
stages:
33+
- commit-msg
34+
2635
- repo: https://github.com/ansible/ansible-lint
27-
rev: v6.17.2
36+
rev: v24.7.0
2837
hooks:
2938
- id: ansible-lint
30-
entry: ansible-lint . --force-color
39+
entry: bash -c 'YAMLLINT_CONFIG_FILE=".github/.yamllint.yaml" ansible-lint . --force-color -c .github/.ansible-lint.yml'
3140
pass_filenames: false
3241
always_run: true
3342
additional_dependencies:
3443
- .[community]
3544

3645
- repo: https://github.com/robertdebock/pre-commit
37-
rev: v1.5.2
46+
rev: v1.5.3
3847
hooks:
3948
- id: ansible_role_find_unused_variable
4049
- id: ansible_role_find_empty_files

.yamllint

-58
This file was deleted.

assets/logo.gh-dark-mode-only.png

-9.98 KB
Binary file not shown.

assets/logo.gh-light-mode-only.png

-12.4 KB
Binary file not shown.

assets/screenshot.png

-475 KB
Binary file not shown.

0 commit comments

Comments
 (0)