Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add MegaLinter config for non-applicable rules and jscpd threshold - #3865

#3865
Open
plengauer with Copilot wants to merge 2 commits into
mainplengauer/Thoth:mainfrom
copilot/disable-bash-exec-ruleplengauer/Thoth:copilot/disable-bash-exec-ruleCopy head branch name to clipboard
Open

Add MegaLinter config for non-applicable rules and jscpd threshold#3865
plengauer with Copilot wants to merge 2 commits into
mainplengauer/Thoth:mainfrom
copilot/disable-bash-exec-ruleplengauer/Thoth:copilot/disable-bash-exec-ruleCopy head branch name to clipboard

Conversation

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

This adds repository-level MegaLinter configuration for findings that do not map cleanly to this repo’s execution model, and makes jscpd usable by replacing MegaLinter’s effectively-zero-tolerance default with an explicit threshold.

  • Disable non-applicable linters

    • BASH_EXEC: shell files here are sourced, piped into sh, invoked via explicit interpreters, or spawned by other entrypoints; executable-bit enforcement is not a meaningful signal.
    • JAVASCRIPT_STANDARD: the codebase uses semicolons consistently, so standard mostly reports style noise rather than actionable defects.
  • Scope broad file-mode linting away from generated/captured artifacts

    • exclude compiled workflow lockfiles: *.lock.yml
    • exclude captured demo exports: **/otlp.json
    • exclude vendored/generated wrappers and lockfiles: **/gradlew, **/package-lock.json
  • Narrow lychee to reader-facing content

    • exclude .github/workflows/ from lychee so placeholder/template URLs in workflow YAML do not produce dead-link noise
  • Configure jscpd explicitly

    • add .jscpd.json with threshold: 5
    • mirror generated-file ignores there, since jscpd runs in project mode and does not inherit MegaLinter’s top-level file filters
# .mega-linter.yml
DISABLE_LINTERS:
  - BASH_EXEC
  - JAVASCRIPT_STANDARD

FILTER_REGEX_EXCLUDE: "(\\.lock\\.yml|/otlp\\.json|/gradlew|/package-lock\\.json)$"
SPELL_LYCHEE_FILTER_REGEX_EXCLUDE: "\\.github/workflows/"
{
  "threshold": 5,
  "reporters": ["console", "html"],
  "ignore": [
    "**/*.lock.yml",
    "**/otlp.json",
    "**/gradlew",
    "**/package-lock.json"
  ]
}

@plengauer

Copy link
Copy Markdown
Owner

Hello, thanks for contributing for the first time!

Copilot AI changed the title [WIP] Disable BASH_EXEC rule for repository Add MegaLinter config for non-applicable rules and jscpd threshold Jul 25, 2026
Copilot AI requested a review from plengauer July 25, 2026 23:44
@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown

MegaLinter analysis: Error

Descriptor Linter Files Fixed Errors Warnings Elapsed time
❌ COPYPASTE jscpd yes 811 no 9.26s
✅ JSON jsonlint 1 0 0 0.09s
✅ JSON prettier 1 0 0 0.31s
✅ JSON v8r 1 0 0 2.75s
✅ REPOSITORY betterleaks yes no no 4.57s
✅ REPOSITORY checkov yes no no 27.22s
❌ REPOSITORY devskim yes 2027 185 137.35s
✅ REPOSITORY dustilock yes no no 1.17s
✅ REPOSITORY gitleaks yes no no 70.03s
✅ REPOSITORY git_diff yes no no 0.11s
❌ REPOSITORY grype yes 2 no 115.25s
❌ REPOSITORY kingfisher yes 1 4 21.82s
❌ REPOSITORY osv-scanner yes 2 no 1.31s
✅ REPOSITORY secretlint yes no no 4.33s
✅ REPOSITORY syft yes no no 8.37s
❌ REPOSITORY trivy yes 11 6 11.96s
✅ REPOSITORY trivy-sbom yes no no 1.12s
✅ REPOSITORY trufflehog yes no no 5.66s
❌ SPELL cspell 3 4 0 4.27s
❌ SPELL lychee 2 2 0 5.13s
✅ YAML prettier 1 0 0 0.63s
✅ YAML v8r 1 0 0 4.54s
✅ YAML yamllint 1 0 0 1.22s

Detailed Issues

❌ SPELL / cspell - 4 errors
.jscpd.json:9:9       - Unknown word (gradlew)    -- "**/gradlew",
	 Suggestions: [gradle, gradely, grade, grable, graded]
.mega-linter.yml:11:8      - Unknown word (otelapi)    -- # `. otelapi.sh` sourcing, `bash
	 Suggestions: [openapi, otelaws, OpenAPI, toecap, outleap]
.mega-linter.yml:31:8      - Unknown word (gradlew)    -- # - **/gradlew is the standard Gradle
	 Suggestions: [gradle, gradely, grade, grable, graded]
.mega-linter.yml:33:53     - Unknown word (gradlew)    -- \.yml|/otlp\\.json|/gradlew|/package-lock\\.json
	 Suggestions: [gradle, gradely, grade, grable, graded]
CSpell: Files checked: 3, Issues found: 4 in 2 files.


You can skip this misspellings by defining the following .cspell.json file at the root of your repository
Of course, please correct real typos before :)

{
    "version": "0.2",
    "language": "en",
    "ignorePaths": [
        "**/node_modules/**",
        "**/vscode-extension/**",
        "**/.git/**",
        "**/.pnpm-lock.json",
        ".vscode",
        "package-lock.json",
        "megalinter-reports"
    ],
    "words": [
        "gradlew",
        "otelapi"
    ]
}


You can also copy-paste megalinter-reports/.cspell.json at the root of your repository
❌ REPOSITORY / devskim - 2027 errors

No output available

❌ REPOSITORY / grype - 2 errors

No output available

❌ COPYPASTE / jscpd - 811 errors
/auto/test_auto_curl.sh [19:19 - 25:84] (7 lines, 80 tokens)
   tests/auto/test_auto_curl.sh [39:29 - 45:84]
Clone found (bash)
 - tests/auto/test_auto_curl.sh [30:61 - 35:14] (6 lines, 54 tokens)
   tests/auto/test_auto_curl.sh [64:68 - 69:14]
Clone found (bash)
 - tests/auto/test_auto_curl.sh [32:1 - 37:14] (6 lines, 62 tokens)
   tests/auto/test_auto_wget.sh [32:1 - 37:14]
Clone found (bash)
 - tests/auto/test_auto_curl.sh [49:1 - 54:14] (6 lines, 62 tokens)
   tests/auto/test_auto_wget.sh [49:1 - 54:14]
Clone found (bash)
 - tests/auto/test_auto_injection_node.sh [67:1 - 79:26] (13 lines, 65 tokens)
   tests/auto/test_auto_injection_node.sh [98:1 - 110:26]
Clone found (bash)
 - tests/auto/test_auto_injection_node.sh [80:1 - 98:6] (19 lines, 117 tokens)
   tests/auto/test_auto_injection_node.sh [112:1 - 130:6]
Clone found (bash)
 - tests/auto/test_auto_injection_node.sh [109:9 - 115:14] (7 lines, 54 tokens)
   tests/auto/test_auto_injection_node.sh [135:2 - 141:14]
Clone found (bash)
 - tests/auto/test_auto_netcat.sh [98:19 - 104:193] (7 lines, 69 tokens)
   tests/auto/test_auto_netcat.sh [109:33 - 115:193]
Clone found (bash)
 - tests/auto/test_auto_wget.sh [20:19 - 28:37] (9 lines, 92 tokens)
   tests/auto/test_auto_wget.sh [39:29 - 48:20]
┌────────────┬────────────────┬─────────────┬──────────────┬──────────────┬──────────────────┬───────────────────┐
│ Format     │ Files analyzed │ Total lines │ Total tokens │ Clones found │ Duplicated lines │ Duplicated tokens │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ bash       │ 110            │ 8522        │ 58441        │ 59           │ 617 (7.24%)      │ 6078 (10.40%)     │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ c          │ 2              │ 334         │ 2652         │ 4            │ 26 (7.78%)       │ 236 (8.90%)       │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ java       │ 6              │ 313         │ 2886         │ 2            │ 10 (3.19%)       │ 142 (4.92%)       │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ javascript │ 9              │ 296         │ 2690         │ 5            │ 69 (23.31%)      │ 632 (23.49%)      │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ json       │ 7              │ 4003        │ 10717        │ 27           │ 888 (22.18%)     │ 2640 (24.63%)     │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ kotlin     │ 2              │ 57          │ 703          │ 0            │ 0 (0.00%)        │ 0 (0.00%)         │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ log        │ 1              │ 104         │ 2847         │ 0            │ 0 (0.00%)        │ 0 (0.00%)         │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ markdown   │ 18             │ 29221       │ 114942       │ 0            │ 0 (0.00%)        │ 0 (0.00%)         │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ markup     │ 1              │ 21          │ 135          │ 0            │ 0 (0.00%)        │ 0 (0.00%)         │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ python     │ 3              │ 733         │ 5265         │ 1            │ 22 (3.00%)       │ 141 (2.68%)       │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ text       │ 16             │ 28668       │ 113444       │ 603          │ 21818 (76.11%)   │ 79419 (70.01%)    │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ txt        │ 2              │ 16          │ 134          │ 0            │ 0 (0.00%)        │ 0 (0.00%)         │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ yaml       │ 34             │ 5666        │ 39079        │ 110          │ 1524 (26.90%)    │ 10087 (25.81%)    │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ Total:     │ 211            │ 77954       │ 353935       │ 811          │ 24974 (32.04%)   │ 99375 (28.08%)    │
└────────────┴────────────────┴─────────────┴──────────────┴──────────────┴──────────────────┴───────────────────┘
Found 811 clones.
HTML report saved to megalinter-reports/copy-paste/jscpd-report.html
ERROR: jscpd found too many duplicates (32.0%) over threshold (5.0%)
time: 877.248ms

(Truncated to last 5000 characters out of 141837)
❌ REPOSITORY / kingfisher - 1 error

No output available

❌ SPELL / lychee - 2 errors
📝 Summary
---------------------
🔍 Total............3
🔗 Unique...........3
✅ Successful.......1
⏳ Timeouts.........0
🔀 Redirected.......0
👻 Excluded.........0
❓ Unknown..........0
🚫 Errors...........2
⛔ Unsupported......2

Errors in .mega-linter.yml
[404] https://github.com/owner/repo/actions/runs/12345 (at 38:14) | Rejected status code: 404 Not Found
[ERROR] https://x-access-token/ (at 39:3) | Connection failed. Check network connectivity and firewall settings

Hint: You can configure accepted/rejected response codes with `-a` or `--accept`
❌ REPOSITORY / osv-scanner - 2 errors
Scanning dir .
Starting filesystem walk for root: /
Scanned src/opt/opentelemetry_shell/requirements.txt file and found 8 packages
Scanned src/usr/share/opentelemetry_shell/agent.instrumentation.java/pom.xml file and found 2 packages
Scanned src/usr/share/opentelemetry_shell/agent.instrumentation.python/requirements.txt file and found 8 packages
Scanned src/usr/share/opentelemetry_shell/agent.instrumentation.python/instrumentation_roots_requirements.txt file and found 2 packages
Scanned actions/instrument/job/package-lock.json file and found 157 packages
End status: 92 dirs visited, 536 inodes visited, 5 Extract calls, 19.151137ms elapsed, 19.151357ms wall time
Warning: enricher transitivedependency/pomxml may be risky when run on untrusted artifacts. Please ensure you trust the source code and artifacts.
failed resolution for src/usr/share/opentelemetry_shell/agent.instrumentation.java/pom.xml: failed resolving {Maven:dummy:dummy[Concrete:0] {}}: rpc error: code = Unavailable desc = service unavailable
failed resolution for src/usr/share/opentelemetry_shell/agent.instrumentation.python/requirements.txt: rpc error: code = Unavailable desc = service unavailable
failed resolution for src/usr/share/opentelemetry_shell/agent.instrumentation.python/instrumentation_roots_requirements.txt: rpc error: code = Unavailable desc = service unavailable
failed resolution for src/opt/opentelemetry_shell/requirements.txt: rpc error: code = Unavailable desc = service unavailable
Error during extraction: (extracting as transitivedependency/pomxml) failed resolution for src/usr/share/opentelemetry_shell/agent.instrumentation.java/pom.xml: failed resolving {Maven:dummy:dummy[Concrete:0] {}}: rpc error: code = Unavailable desc = service unavailable
Error during extraction: (extracting as transitivedependency/requirements) failed resolution for src/usr/share/opentelemetry_shell/agent.instrumentation.python/requirements.txt: rpc error: code = Unavailable desc = service unavailable
failed resolution for src/usr/share/opentelemetry_shell/agent.instrumentation.python/instrumentation_roots_requirements.txt: rpc error: code = Unavailable desc = service unavailable
failed resolution for src/opt/opentelemetry_shell/requirements.txt: rpc error: code = Unavailable desc = service unavailable

Total 2 packages affected by 2 known vulnerabilities (0 Critical, 2 High, 0 Medium, 0 Low, 0 Unknown) from 1 ecosystem.
2 vulnerabilities can be fixed.

+-------------------------------------+------+-----------+-----------------+---------+---------------+------------------------------------------+
| OSV URL                             | CVSS | ECOSYSTEM | PACKAGE         | VERSION | FIXED VERSION | SOURCE                                   |
+-------------------------------------+------+-----------+-----------------+---------+---------------+------------------------------------------+
| https://osv.dev/GHSA-mh99-v99m-4gvg | 7.5  | npm       | brace-expansion | 1.1.16  | 5.0.8         | actions/instrument/job/package-lock.json |
| https://osv.dev/GHSA-mh99-v99m-4gvg | 7.5  | npm       | brace-expansion | 2.1.2   | 5.0.8         | actions/instrument/job/package-lock.json |
+-------------------------------------+------+-----------+-----------------+---------+---------------+------------------------------------------+


[REPOSITORY_OSV_SCANNER_ERROR_SERVICE_UNAVAILABLE] osv-scanner could not reach the deps.dev / OSV transitive-dependency resolution service (gRPC "service unavailable").
This is a transient remote service issue, not a vulnerability finding.
Workarounds:
  - Retry the run later.
  - Temporarily mark the linter as non-blocking by adding to your .mega-linter.yml:
      DISABLE_ERRORS_LINTERS:
        - REPOSITORY_OSV_SCANNER
❌ REPOSITORY / trivy - 11 errors

No output available

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@plengauer
plengauer marked this pull request as ready for review July 26, 2026 07:04
@plengauer
plengauer requested a review from moflwi as a code owner July 26, 2026 07:04
Copilot AI review requested due to automatic review settings July 26, 2026 07:04
@plengauer
plengauer enabled auto-merge (squash) July 26, 2026 07:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Adds repository-level MegaLinter and jscpd configuration to reduce non-actionable findings and make duplication checks usable in this repo’s workflow model.

Changes:

  • Introduces .mega-linter.yml to disable non-applicable linters and exclude generated/captured artifacts from broad file-mode linting.
  • Narrows Lychee scope to reader-facing content by excluding .github/workflows/.
  • Adds .jscpd.json with an explicit duplication threshold and ignore list aligned to generated artifacts.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.mega-linter.yml Disables selected linters and excludes generated/captured paths; scopes Lychee away from workflows.
.jscpd.json Sets jscpd threshold/reporters and ignores generated/artifact files for project runs.

Comment thread .mega-linter.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MegaLinter][rule doesn't apply] BASH_EXEC and JAVASCRIPT_STANDARD disabled; jscpd threshold reconfigured

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.