Skip to content

Commit 81ef94f

Browse files
shiranrtompaana
andauthored
Add mega linter (microsoft#845)
* Add mega linter * Add workflow for mega linter * change the mega linter check * Remove trailing spaces * Disable HTML and Docker file linters * Disable JSON linters * fix reviewers.yml * Disable cspell Small fixes the mega linter did * Disable cspell errors to warnings for now * push linter fixes * fix 403 issues with links from GH and other sites. Workaround: tcort/markdown-link-check#201 * fix links * Remove internal links * Delete markdownlint.yml * Fix linting for mkdocs.yml * Disable old linter * Fix broken links * Fix broken links * Remove mega linter * Fix broken links * Fix broken links * fix broken links * Remove uneeded spell checks from the cspell config * Keep fixing cspell stopped at: overfitting * Keep fixing cspell stopped at: overfitting * Update package lock. * fix documentation * ignore failing working link * fix spell * Add 302 as alive status code * Upgrade mega linter to version 6 * Update to version 6 update to version 6 of mega linter * Update megalinter * remove blank line * Fix file * change root user for Dockerfile * revert * Change the use of root user in the dockerfile * ignore trivy error for docker root user * remove unneeded spaces * Update .github/workflows/mega-linter.yml Co-authored-by: Tomi Paananen <[email protected]> * Update docs/continuous-delivery/secrets-management/README.md Co-authored-by: Tomi Paananen <[email protected]> * Update docs/continuous-delivery/secrets-management/README.md Co-authored-by: Tomi Paananen <[email protected]> * Update docs/agile-development/basics/Ceremonies/README.md Co-authored-by: Tomi Paananen <[email protected]> * Update .projector/workItemTemplates/kubernetes-at-the-edge.yml Co-authored-by: Tomi Paananen <[email protected]> * Update .projector/workItemTemplates/kubernetes-at-the-edge.yml Co-authored-by: Tomi Paananen <[email protected]> * Update docs/observability/pillars/dashboard.md Co-authored-by: Tomi Paananen <[email protected]> Co-authored-by: Tomi Paananen <[email protected]>
1 parent 8287ee7 commit 81ef94f

File tree

72 files changed

+1055
-1651
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1055
-1651
lines changed

.cspell.json

+433
Large diffs are not rendered by default.

.github/reviewers.yml

+16-16
Original file line numberDiff line numberDiff line change
@@ -61,37 +61,37 @@ reviewers:
6161
files:
6262
# Keys are glob expressions.
6363
# You can assign groups defined above as well as GitHub usernames.
64-
'docs/**':
64+
"docs/**":
6565
- general # group
66-
'docs/agile-development/**':
66+
"docs/agile-development/**":
6767
- agile # group
68-
'docs/automated-testing/**':
68+
"docs/automated-testing/**":
6969
- automated-testing # group
70-
'docs/code-reviews/**':
70+
"docs/code-reviews/**":
7171
- code-reviews # group
72-
'docs/continuous-delivery/**':
72+
"docs/continuous-delivery/**":
7373
- ci-cd # group
74-
'docs/continuous-integration/**':
74+
"docs/continuous-integration/**":
7575
- ci-cd # group
76-
'docs/design/**':
76+
"docs/design/**":
7777
- design # group
78-
'docs/developer-experience/**':
78+
"docs/developer-experience/**":
7979
- dev-experience # group
80-
'docs/documentation/**':
80+
"docs/documentation/**":
8181
- documentation # group
82-
'docs/machine-learning/**':
82+
"docs/machine-learning/**":
8383
- machine-learning # group
84-
'docs/observability/**':
84+
"docs/observability/**":
8585
- observability # group
86-
'docs/privacy/**':
86+
"docs/privacy/**":
8787
- privacy # group
88-
'docs/security/**':
88+
"docs/security/**":
8989
- security # group
90-
'docs/source-control/**':
90+
"docs/source-control/**":
9191
- source-code # group
92-
'.projector/**':
92+
".projector/**":
9393
- design # group
94-
'docs/user-interface-engineering/**':
94+
"docs/user-interface-engineering/**":
9595
- ux # group
9696

9797
options:

.github/workflows/markdownlint.yml

-29
This file was deleted.

.github/workflows/mega-linter.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
# MegaLinter GitHub Action configuration file
3+
# More info at https://oxsecurity.github.io/megalinter
4+
name: MegaLinter
5+
6+
on:
7+
# Trigger mega-linter at every push. Action will also be visible from pull requests to main
8+
push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
9+
pull_request:
10+
branches: [master, main]
11+
12+
env: # Comment env block if you do not want to apply fixes
13+
# Apply linter fixes configuration
14+
APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool)
15+
APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all)
16+
APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request)
17+
18+
concurrency:
19+
group: ${{ github.ref }}-${{ github.workflow }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
build:
24+
name: MegaLinter
25+
runs-on: ubuntu-latest
26+
steps:
27+
# Git Checkout
28+
- name: Checkout Code
29+
uses: actions/checkout@v3
30+
with:
31+
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
32+
fetch-depth: 0
33+
34+
# MegaLinter
35+
- name: MegaLinter
36+
id: ml
37+
# You can override MegaLinter flavor used to have faster performances
38+
# More info at https://oxsecurity.github.io/megalinter/flavors/
39+
uses: oxsecurity/megalinter/flavors/documentation@v6
40+
env:
41+
# All available variables are described in documentation
42+
# https://oxsecurity.github.io/megalinter/configuration/
43+
VALIDATE_ALL_CODEBASE: true # Set ${{ github.event_name == &#39;push&#39; &amp;&amp; github.ref == &#39;refs/heads/main&#39; }} to validate only diff with main branch
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
# ADD YOUR CUSTOM ENV VARIABLES HERE TO OVERRIDE VALUES OF .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
46+
47+
# Upload MegaLinter artifacts
48+
- name: Archive production artifacts
49+
if: ${{ success() }} || ${{ failure() }}
50+
uses: actions/upload-artifact@v2
51+
with:
52+
name: MegaLinter reports
53+
path: |
54+
report
55+
mega-linter.log
56+
57+
# Create pull request if applicable (for now works only on PR from same repository, not from forks)
58+
- name: Create Pull Request with applied fixes
59+
id: cpr
60+
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
61+
uses: peter-evans/create-pull-request@v4
62+
with:
63+
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
64+
commit-message: "[MegaLinter] Apply linters automatic fixes"
65+
title: "[MegaLinter] Apply linters automatic fixes"
66+
labels: bot
67+
- name: Create PR output
68+
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
69+
run: |
70+
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
71+
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
72+
73+
# Push new commit if applicable (for now works only on PR from same repository, not from forks)
74+
- name: Prepare commit
75+
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
76+
run: sudo chown -Rc $UID .git/
77+
- name: Commit and push applied linter fixes
78+
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
79+
uses: stefanzweifel/git-auto-commit-action@v4
80+
with:
81+
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
82+
commit_message: "[MegaLinter] Apply linters fixes"

.github/workflows/mkdocs.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ jobs:
77
deploy:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1111
with:
12-
submodules: "recursive"
13-
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
12+
submodules: "recursive"
13+
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
1414
- name: Setup Python
1515
uses: actions/setup-python@v1
1616
with:
17-
python-version: '3.7'
18-
architecture: 'x64'
17+
python-version: "3.7"
18+
architecture: "x64"
1919
- name: Install dependencies
2020
run: |
21-
python3 -m pip install --upgrade pip
22-
python3 -m pip install wheel
21+
python3 -m pip install --upgrade pip
22+
python3 -m pip install wheel
2323
python3 -m pip install -r requirements-docs.txt
2424
- name: Build site
2525
run: mkdocs build

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -340,4 +340,5 @@ _site
340340

341341
# mkdocs
342342
site/
343-
mkdocs/
343+
mkdocs/
344+
megalinter-reports/

.jscpd.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"threshold": 0,
3+
"reporters": ["html", "markdown"],
4+
"ignore": [
5+
"**/node_modules/**",
6+
"**/.git/**",
7+
"**/.rbenv/**",
8+
"**/.venv/**",
9+
"**/*cache*/**",
10+
"**/.github/**",
11+
"**/.idea/**",
12+
"**/report/**",
13+
"**/*.svg"
14+
]
15+
}

.markdown-link-check.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"ignorePatterns": [
3+
{"pattern": "^./INSERT_URL_TO_ISSUE"},
4+
{"pattern": "^./link-to-the-work-item"},
5+
{"pattern": "^https://portal.azure.com"},
6+
{"pattern": "^http://link-to-feature-or-story-work-item"},
7+
{"pattern": "^http://link-to-task-work-item"},
8+
{"pattern": "^http://link-to-story-work-item"},
9+
{"pattern": "^http://link-to-work-item"},
10+
{"pattern": "^https://tanzu.vmware.com/developer/guides/kubernetes/observability-prometheus-grafana-p1"},
11+
{"pattern": "^https://www.w3.org/blog/2019/12/trace-context-enters-proposed-recommendation/"},
12+
{"pattern": "^https://blog.cloudflare.com/cloudflare-outage/"},
13+
{"pattern": "^https://thanos.io"},
14+
{"pattern": "^https://gitlab.com/palisade/palisade-release"},
15+
{"pattern": "(.*\\.)?.opentelemetry.io"},
16+
{"pattern": "(.*\\.)?.pluralsight.com"},
17+
{"pattern": "(.*\\.)?.github.com"},
18+
{"pattern": "^https://marketplace.visualstudio.com"},
19+
{"pattern": "^https://opensource.org/licenses/MIT"},
20+
{"pattern": "^https://www.researchgate.net/publication/301839557_The_landscape_of_software_failure_cause_models"},
21+
{"pattern": "^https://www.cmu.edu/iso/governance/guidelines/data-classification.html"}
22+
],
23+
"httpHeaders": [
24+
{
25+
"urls": ["https://docs.github.com/",
26+
"https://help.github.com/",
27+
"https://github.com/",
28+
"https://blog.cloudflare.com/"],
29+
"headers": {
30+
"Accept-Encoding": "zstd, br, gzip, deflate"
31+
}
32+
}
33+
],
34+
"retryOn429": true,
35+
"aliveStatusCodes": [200, 206, 302]
36+
}

.markdownlinkcheck.json

+13-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,20 @@
1515
{"pattern": "(.*\\.)?.opentelemetry.io"},
1616
{"pattern": "(.*\\.)?.pluralsight.com"},
1717
{"pattern": "(.*\\.)?.github.com"},
18-
{"pattern": "^https://marketplace.visualstudio.com"}
18+
{"pattern": "^https://marketplace.visualstudio.com"},
1919
{"pattern": "^https://opensource.org/licenses/MIT"}
2020
],
21+
"httpHeaders": [
22+
{
23+
"urls": ["https://docs.github.com/",
24+
"https://help.github.com/",
25+
"https://github.com/",
26+
"https://blog.cloudflare.com/",
27+
"https://www.researchgate.net/"],
28+
"headers": {
29+
"Accept-Encoding": "zstd, br, gzip, deflate"
30+
}
31+
}
32+
],
2133
"retryOn429": true
2234
}

.mega-linter.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Configuration file for MegaLinter
2+
# See all available variables at https://oxsecurity.github.io/megalinter/configuration/ and in linters documentation
3+
4+
APPLY_FIXES: all # all, none, or list of linter keys
5+
# ENABLE: # If you use ENABLE variable, all other languages/formats/tooling-formats will be disabled by default
6+
# ENABLE_LINTERS: # If you use ENABLE_LINTERS variable, all other linters will be disabled by default
7+
DISABLE:
8+
- COPYPASTE # Comment to enable checks of excessive copy-pastes
9+
- HTML
10+
- DOCKERFILE
11+
- JSON
12+
SPELL_CSPELL_DISABLE_ERRORS: true
13+
SHOW_ELAPSED_TIME: true
14+
FILEIO_REPORTER: false
15+
# DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass

.pre-commit-config.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
repos:
2-
- repo: https://github.com/markdownlint/markdownlint
3-
rev: v0.11.0
4-
hooks:
5-
- id: markdownlint
6-
name: Markdownlint
7-
description: Run markdownlint on your Markdown files
8-
entry: mdl
9-
language: ruby
10-
files: \.(md|mdown|markdown)$
2+
- repo: https://github.com/markdownlint/markdownlint
3+
rev: v0.11.0
4+
hooks:
5+
- id: markdownlint
6+
name: Markdownlint
7+
description: Run markdownlint on your Markdown files
8+
entry: mdl
9+
language: ruby
10+
files: \.(md|mdown|markdown)$

0 commit comments

Comments
 (0)