Skip to content
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
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
version: 2
updates:
- package-ecosystem: docker
commit-message:
prefix: build
include: scope
open-pull-requests-limit: 20
directory: "/"
schedule:
Expand All @@ -16,6 +19,9 @@ updates:
- "*"

- package-ecosystem: docker
commit-message:
prefix: build
include: scope
open-pull-requests-limit: 20
directories:
- "/images/*"
Expand All @@ -28,6 +34,9 @@ updates:
default-days: 7

- package-ecosystem: npm
commit-message:
prefix: build
include: scope
open-pull-requests-limit: 20
directory: "/images/testcontainers-node"
schedule:
Expand All @@ -42,6 +51,9 @@ updates:
- "*"

- package-ecosystem: github-actions
commit-message:
prefix: build
include: scope
open-pull-requests-limit: 20
directories:
- "/"
Expand All @@ -58,6 +70,9 @@ updates:
- "*"

- package-ecosystem: "devcontainers"
commit-message:
prefix: build
include: scope
open-pull-requests-limit: 20
directory: "/"
schedule:
Expand Down
6 changes: 6 additions & 0 deletions images/super-linter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ arguments supplied through `GITHUB_ACTIONS_COMMAND_ARGS` are preserved.

## Commitlint configuration

The shared policy is the unmodified
[`@commitlint/config-conventional` preset](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional),
including its Conventional Commits parser. It accepts breaking-change headers
such as `feat!:` and applies the same rules to contributor and bot messages.
The preset and validator versions are supplied by the pinned image.

Commitlint discovers project configuration itself, including parent directories
and the `commitlint` field in `package.json` or `package.yaml`. Project rules take
precedence over the bundled rules.
Expand Down
32 changes: 1 addition & 31 deletions images/super-linter/commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
module.exports = {
rules: {
"body-leading-blank": [1, "always"],
"footer-leading-blank": [1, "always"],
"header-max-length": [2, "always", 100],
"subject-case": [
2,
"never",
["sentence-case", "start-case", "pascal-case", "upper-case"],
],
"subject-empty": [2, "never"],
"subject-full-stop": [2, "never", "."],
"type-case": [2, "always", "lower-case"],
"type-empty": [2, "never"],
"type-enum": [
2,
"always",
[
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
],
],
},
extends: ["@commitlint/config-conventional"],
};
18 changes: 16 additions & 2 deletions images/super-linter/super-linter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,17 +234,31 @@ exec sleep infinity`,

for (const [message, expectedExitCode] of [
["feat: add a shared linter", 0],
["feat!: change the release contract", 0],
[
"feat(api)!: change the release contract\n\nBREAKING CHANGE: callers must supply a release tag",
0,
],
["build(deps): bump a dependency", 0],
["build(deps): Bump a dependency", 1],
[
"unknown(deps): bump a dependency\n\nupdated-dependencies:\n- dependency-name: example\n\nSigned-off-by: dependabot[bot] <support@github.com>",
1,
],
["fix: keep headers bounded ".padEnd(101, "x"), 1],
[`fix: keep body lines bounded\n\n${"x".repeat(101)}`, 1],
["fix: end a subject with a full stop.", 1],
["invalid commit message", 1],
]) {
it(`validates '${message}' without writing in the workspace`, async () => {
const { exitCode, workspace } = await runEntrypoint(
const { exitCode, output, workspace } = await runEntrypoint(
[
"-c",
'printf "%s\\n" "$COMMIT_MESSAGE" | commitlint --cwd "$DEFAULT_WORKSPACE"',
],
{ COMMIT_MESSAGE: message },
);
assert.strictEqual(exitCode, expectedExitCode);
assert.strictEqual(exitCode, expectedExitCode, output);
const files = await container.exec(["ls", "-A", workspace]);
assert.strictEqual(files.output, "");
});
Expand Down
1 change: 1 addition & 0 deletions images/super-linter/tests/commitlint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ git init --quiet --initial-branch=main
git config user.name Test
git config user.email test@example.com
git commit --quiet --allow-empty -m 'feat: initialize fixture'
git commit --quiet --allow-empty -m 'feat!: change the fixture contract'

export DEFAULT_WORKSPACE="$workspace"
export VALIDATE_JAVASCRIPT_TOOLCHAIN='' VALIDATE_PYTHON_TOOLCHAIN=''
Expand Down
Loading