Skip to content

Commit 87b7238

Browse files
chore(repo): sync with repository template
template: <https://github.com/liblaf/repo>
1 parent bee3328 commit 87b7238

File tree

9 files changed

+291
-11
lines changed

9 files changed

+291
-11
lines changed

.cspell.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/packages/cspell-types/cspell.schema.json",
3+
"version": "0.2",
4+
"language": "en",
5+
"words": [],
6+
"ignorePaths": [
7+
".vscode",
8+
"**/.cspell.*",
9+
"**/.git/**",
10+
"**/*-lock.*",
11+
"**/*.lock*",
12+
"**/node_modules/**",
13+
"**/vscode-extension/**",
14+
"megalinter",
15+
"report"
16+
],
17+
"allowCompoundWords": true
18+
}

.github/auto-label.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
language:
44
pullrequest: true
5+
labelprefix: "lang: "
6+
7+
path:
8+
pullrequest: true
9+
paths:
10+
docs: "type: docs"
511

612
staleness:
713
pullrequest: true

.github/blunderbuss.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ assign_prs:
88

99
ignore_authors:
1010
- dependabot[bot]
11+
- pre-commit-ci[bot]
1112
- renovate[bot]

.github/megalinter/.checkov.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# ref: <https://github.com/oxsecurity/megalinter/blob/225e1b5c3a044775005d0ec772cabee5d21006ed/TEMPLATES/.checkov.yml>
2+
3+
# You can see all available properties here: https://github.com/bridgecrewio/checkov#configuration-using-a-config-file
4+
quiet: true
5+
6+
skip-check:
7+
- CKV_DOCKER_2
8+
- CKV_GHA_7
9+
- CKV2_GHA_1

.github/megalinter/.devskim.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"IgnoreRuleIds": ["DS176209"],
3+
"Globs": ["**/.git/**", "**/megalinter-reports/**"]
4+
}

.github/megalinter/kics.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
exclude-queries:
2+
- 555ab8f9-2001-455e-a077-f2d0f41e2fb9

.github/workflows/megalinter.yaml

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
# ref: <https://github.com/oxsecurity/megalinter/blob/225e1b5c3a044775005d0ec772cabee5d21006ed/mega-linter-runner/generators/mega-linter/templates/mega-linter.yml>
2+
3+
# MegaLinter GitHub Action configuration file
4+
# More info at https://megalinter.io
5+
---
6+
name: MegaLinter
7+
8+
# Trigger mega-linter at every push. Action will also be visible from
9+
# Pull Requests to main
10+
on:
11+
# Comment this line to trigger action only on pull-requests
12+
# (not recommended if you don't pay for GH Actions)
13+
push:
14+
15+
pull_request:
16+
branches:
17+
- main
18+
- master
19+
20+
# Comment env block if you do not want to apply fixes
21+
env:
22+
# Apply linter fixes configuration
23+
#
24+
# When active, APPLY_FIXES must also be defined as environment variable
25+
# (in github/workflows/mega-linter.yml or other CI tool)
26+
APPLY_FIXES: all
27+
28+
# Decide which event triggers application of fixes in a commit or a PR
29+
# (pull_request, push, all)
30+
APPLY_FIXES_EVENT: pull_request
31+
32+
# If APPLY_FIXES is used, defines if the fixes are directly committed (commit)
33+
# or posted in a PR (pull_request)
34+
APPLY_FIXES_MODE: commit
35+
36+
concurrency:
37+
group: ${{ github.ref }}-${{ github.workflow }}
38+
cancel-in-progress: true
39+
40+
jobs:
41+
megalinter:
42+
name: MegaLinter
43+
runs-on: ubuntu-latest
44+
45+
# Give the default GITHUB_TOKEN write permission to commit and push, comment
46+
# issues, and post new Pull Requests; remove the ones you do not need
47+
permissions:
48+
contents: write
49+
issues: write
50+
pull-requests: write
51+
52+
steps:
53+
# Git Checkout
54+
- name: Checkout Code
55+
uses: actions/checkout@v4
56+
with:
57+
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
58+
59+
# If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to
60+
# improve performance
61+
fetch-depth: 0
62+
63+
# MegaLinter
64+
- name: MegaLinter
65+
66+
# You can override MegaLinter flavor used to have faster performances
67+
# More info at https://megalinter.io/latest/flavors/
68+
uses: oxsecurity/megalinter@v8
69+
70+
id: ml
71+
72+
# All available variables are described in documentation
73+
# https://megalinter.io/latest/config-file/
74+
env:
75+
# Validates all source when push on main, else just the git diff with
76+
# main. Override with true if you always want to lint all sources
77+
#
78+
# To validate the entire codebase, set to:
79+
# VALIDATE_ALL_CODEBASE: true
80+
#
81+
# To validate only diff with main, set to:
82+
# VALIDATE_ALL_CODEBASE: >-
83+
# ${{
84+
# github.event_name == 'push' &&
85+
# github.ref == 'refs/heads/main'
86+
# }}
87+
VALIDATE_ALL_CODEBASE: true
88+
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
91+
# Uncomment to use ApiReporter (Grafana)
92+
# API_REPORTER: true
93+
# API_REPORTER_URL: ${{ secrets.API_REPORTER_URL }}
94+
# API_REPORTER_BASIC_AUTH_USERNAME: ${{ secrets.API_REPORTER_BASIC_AUTH_USERNAME }}
95+
# API_REPORTER_BASIC_AUTH_PASSWORD: ${{ secrets.API_REPORTER_BASIC_AUTH_PASSWORD }}
96+
# API_REPORTER_METRICS_URL: ${{ secrets.API_REPORTER_METRICS_URL }}
97+
# API_REPORTER_METRICS_BASIC_AUTH_USERNAME: ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_USERNAME }}
98+
# API_REPORTER_METRICS_BASIC_AUTH_PASSWORD: ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_PASSWORD }}
99+
# API_REPORTER_DEBUG: false
100+
101+
# ADD YOUR CUSTOM ENV VARIABLES HERE TO OVERRIDE VALUES OF
102+
# .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
103+
MARKDOWN_SUMMARY_REPORTER: true
104+
continue-on-error: true
105+
106+
- if: success() || failure()
107+
name: Add GitHub Summary
108+
run: cat megalinter-reports/megalinter-report.md >> "$GITHUB_STEP_SUMMARY"
109+
110+
# Upload MegaLinter artifacts
111+
- name: Archive production artifacts
112+
uses: actions/upload-artifact@v4
113+
if: success() || failure()
114+
with:
115+
name: MegaLinter reports
116+
path: |
117+
megalinter-reports
118+
mega-linter.log
119+
120+
# Create pull request if applicable
121+
# (for now works only on PR from same repository, not from forks)
122+
- name: Create Pull Request with applied fixes
123+
uses: peter-evans/create-pull-request@v6
124+
id: cpr
125+
if: >-
126+
steps.ml.outputs.has_updated_sources == 1 &&
127+
(
128+
env.APPLY_FIXES_EVENT == 'all' ||
129+
env.APPLY_FIXES_EVENT == github.event_name
130+
) &&
131+
env.APPLY_FIXES_MODE == 'pull_request' &&
132+
(
133+
github.event_name == 'push' ||
134+
github.event.pull_request.head.repo.full_name == github.repository
135+
) &&
136+
!contains(github.event.head_commit.message, 'skip fix')
137+
with:
138+
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
139+
commit-message: "[MegaLinter] Apply linters automatic fixes"
140+
title: "[MegaLinter] Apply linters automatic fixes"
141+
labels: bot
142+
143+
- name: Create PR output
144+
if: >-
145+
steps.ml.outputs.has_updated_sources == 1 &&
146+
(
147+
env.APPLY_FIXES_EVENT == 'all' ||
148+
env.APPLY_FIXES_EVENT == github.event_name
149+
) &&
150+
env.APPLY_FIXES_MODE == 'pull_request' &&
151+
(
152+
github.event_name == 'push' ||
153+
github.event.pull_request.head.repo.full_name == github.repository
154+
) &&
155+
!contains(github.event.head_commit.message, 'skip fix')
156+
run: |
157+
echo "PR Number - ${{ steps.cpr.outputs.pull-request-number }}"
158+
echo "PR URL - ${{ steps.cpr.outputs.pull-request-url }}"
159+
160+
# Push new commit if applicable
161+
# (for now works only on PR from same repository, not from forks)
162+
- name: Prepare commit
163+
if: >-
164+
steps.ml.outputs.has_updated_sources == 1 &&
165+
(
166+
env.APPLY_FIXES_EVENT == 'all' ||
167+
env.APPLY_FIXES_EVENT == github.event_name
168+
) &&
169+
env.APPLY_FIXES_MODE == 'commit' &&
170+
github.ref != 'refs/heads/main' &&
171+
(
172+
github.event_name == 'push' ||
173+
github.event.pull_request.head.repo.full_name == github.repository
174+
) &&
175+
!contains(github.event.head_commit.message, 'skip fix')
176+
run: sudo chown -Rc $UID .git/
177+
178+
- name: Commit and push applied linter fixes
179+
uses: stefanzweifel/git-auto-commit-action@v5
180+
if: >-
181+
steps.ml.outputs.has_updated_sources == 1 &&
182+
(
183+
env.APPLY_FIXES_EVENT == 'all' ||
184+
env.APPLY_FIXES_EVENT == github.event_name
185+
) &&
186+
env.APPLY_FIXES_MODE == 'commit' &&
187+
github.ref != 'refs/heads/main' &&
188+
(
189+
github.event_name == 'push' ||
190+
github.event.pull_request.head.repo.full_name == github.repository
191+
) &&
192+
!contains(github.event.head_commit.message, 'skip fix')
193+
with:
194+
branch: >-
195+
${{
196+
github.event.pull_request.head.ref ||
197+
github.head_ref ||
198+
github.ref
199+
}}
200+
commit_message: "[MegaLinter] Apply linters fixes"
201+
commit_user_name: megalinter-bot
202+
commit_user_email: nicolas.vuillamy@ox.security

.mega-linter.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/megalinter/megalinter/main/megalinter/descriptors/schemas/megalinter-configuration.jsonschema.json
2+
3+
# Configuration file for MegaLinter
4+
#
5+
# See all available variables at https://megalinter.io/latest/config-file/ and in
6+
# linters documentation
7+
8+
# all, none, or list of linter keys
9+
APPLY_FIXES: all
10+
11+
# If you use ENABLE variable, all other languages/formats/tooling-formats will
12+
# be disabled by default
13+
# ENABLE:
14+
15+
# If you use ENABLE_LINTERS variable, all other linters will be disabled by
16+
# default
17+
# ENABLE_LINTERS:
18+
19+
# DISABLE:
20+
# - COPYPASTE # Uncomment to disable checks of excessive copy-pastes
21+
# - SPELL # Uncomment to disable checks of spelling mistakes
22+
23+
SHOW_ELAPSED_TIME: true
24+
25+
FILEIO_REPORTER: false
26+
# Uncomment if you want MegaLinter to detect errors but not block CI to pass
27+
# DISABLE_ERRORS: true
28+
29+
DISABLE_LINTERS:
30+
- BASH_EXEC
31+
- PYTHON_BANDIT
32+
- PYTHON_BLACK
33+
- PYTHON_FLAKE8
34+
- PYTHON_ISORT
35+
- PYTHON_MYPY
36+
- PYTHON_PYLINT
37+
38+
DISABLE_ERRORS_LINTERS:
39+
- SPELL_CSPELL
40+
41+
REPOSITORY_CHECKOV_CONFIG_FILE: .github/megalinter/.checkov.yml
42+
REPOSITORY_DEVSKIM_CONFIG_FILE: .github/megalinter/.devskim.json
43+
REPOSITORY_KICS_CONFIG_FILE: .github/megalinter/kics.config

.pre-commit-config.yaml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ ci:
66
- shellcheck
77
repos:
88
- repo: https://github.com/astral-sh/ruff-pre-commit
9-
rev: v0.5.6
9+
rev: v0.6.5
1010
hooks:
1111
- id: ruff
1212
args:
1313
- --fix
1414
- id: ruff-format
1515
- repo: https://github.com/commitizen-tools/commitizen
16-
rev: v3.28.0
16+
rev: v3.29.0
1717
hooks:
1818
- id: commitizen
1919
- repo: https://github.com/koalaman/shellcheck-precommit
@@ -23,11 +23,6 @@ repos:
2323
files: \.(bash|sh|zsh)(\.tmpl)?$
2424
types:
2525
- text
26-
- repo: https://github.com/liblaf/pre-commit-hooks
27-
rev: dev
28-
hooks:
29-
- id: prettier
30-
exclude: (.*-lock\..*)|(.*\.lock)$
3126
- repo: https://github.com/pre-commit/pre-commit-hooks
3227
rev: v4.6.0
3328
hooks:
@@ -52,11 +47,11 @@ repos:
5247
- id: mixed-line-ending
5348
- id: trailing-whitespace
5449
- repo: https://github.com/python-jsonschema/check-jsonschema
55-
rev: 0.29.1
50+
rev: 0.29.2
5651
hooks:
5752
- id: check-github-workflows
5853
- repo: https://github.com/scop/pre-commit-shfmt
59-
rev: v3.8.0-1
54+
rev: v3.9.0-1
6055
hooks:
6156
- id: shfmt
6257
files: \.(bash|sh|zsh)(\.tmpl)?$
@@ -69,12 +64,12 @@ repos:
6964
- --case-indent
7065
- --space-redirects
7166
- repo: https://github.com/sirosen/texthooks
72-
rev: 0.6.6
67+
rev: 0.6.7
7368
hooks:
7469
- id: fix-ligatures
7570
- id: fix-spaces
7671
- id: forbid-bidi-controls
7772
- repo: https://github.com/streetsidesoftware/cspell-cli
78-
rev: v8.13.1
73+
rev: v8.13.3
7974
hooks:
8075
- id: cspell

0 commit comments

Comments
 (0)