# SPDX-FileCopyrightText: 2026 Authelia # # SPDX-License-Identifier: Apache-2.0 --- pre-commit: piped: true jobs: - name: check tools # yamllint disable rule:indentation run: | COUNT=0 for TOOL in golangci-lint jq pnpm reuse scorecard shellcheck trufflehog typos yamllint zizmor; do if ! command -v ${TOOL} >/dev/null 2>&1; then if [ ${COUNT} -eq 0 ]; then MISSING=${TOOL} elif [ ${COUNT} -eq 1 ]; then MISSING=${MISSING}' and '${TOOL} else MISSING=$(echo ${MISSING} | sed 's/ and /, /')' and '${TOOL} fi COUNT=$((COUNT + 1)) fi done if [ ${COUNT} -gt 0 ]; then echo '❌ You must install '${MISSING} exit 1 fi # yamllint enable rule:indentation - name: linters group: parallel: true jobs: - name: docs run: pnpm --reporter=silent lint {staged_files} && echo "0 issues." root: "docs/" stage_fixed: true - name: eslint run: pnpm --reporter=silent lint {staged_files} && echo "0 issues." root: "web/" glob: "*.{js,jsx,ts,tsx}" stage_fixed: true - name: golangci-lint run: golangci-lint run --fix glob: "*.go" stage_fixed: true - name: reuse run: reuse lint-file {staged_files} && echo "0 issues." - name: reuse-project # reuse lint-file only sees the staged files, so a REUSE.toml or LICENSES/ # change that strips coverage from unstaged files needs a full project lint. run: reuse lint --lines && echo "0 issues." glob: "{REUSE.toml,LICENSES/*}" - name: scorecard run: .buildkite/steps/lint.sh scorecard && echo "0 issues." glob: - "*Dockerfile*" - ".github/workflows/*" - ".buildkite/hooks/*" - ".renovaterc*" - "*.sh" - name: shellcheck run: shellcheck --format=gcc {staged_files} && echo "0 issues." file_types: - text/x-shellscript - text/x-sh - name: trufflehog run: trufflehog --fail --log-level=-1 filesystem -x .trufflehog . && echo "0 issues." - name: typos run: typos -w --threads 4 --format brief && echo "0 issues." stage_fixed: true - name: yamllint run: yamllint -f parsable . && echo "0 issues." glob: "*.{yml,yaml}" - name: zizmor run: zizmor {staged_files} && echo "0 issues." glob: ".github/workflows/*.{yml,yaml}" commit-msg: jobs: - name: commitlint run: pnpm commitlint --edit root: "web/" ...