diff --git a/.github/actions/linter_tests/action.yaml b/.github/actions/linter_tests/action.yaml index 0f2af97d3..40850c627 100644 --- a/.github/actions/linter_tests/action.yaml +++ b/.github/actions/linter_tests/action.yaml @@ -20,6 +20,9 @@ inputs: description: Additional args to append to the test invocation required: false default: linters -- + snyk-token: + description: Token to login for snyk test + required: true sourcery-token: description: Token to login for sourcery test required: true @@ -103,6 +106,7 @@ runs: PLUGINS_TEST_LINTER_VERSION: ${{ inputs.linter-version }} PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }} PLUGINS_TEST_CLI_PATH: ${{ env.CLI_PATH }} + SNYK_TOKEN: ${{ inputs.snyk-token }} SOURCERY_TOKEN: ${{ inputs.sourcery-token }} # Debug recurrent eslint circular JSON errors DEBUG: Driver:eslint:*,Driver:nixpkgs-fmt:*,Driver:trunk-toolbox:* diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d7e408fe0..11780764e 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -34,7 +34,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 + uses: github/codeql-action/init@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5 # Override language selection by uncommenting this and choosing your languages with: languages: javascript @@ -42,7 +42,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below). - name: Autobuild - uses: github/codeql-action/autobuild@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 + uses: github/codeql-action/autobuild@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5 # â„šī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -56,4 +56,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 + uses: github/codeql-action/analyze@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5 diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index e7ee84d05..57a1fc226 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -28,14 +28,14 @@ jobs: # This job is used to diagnose plugin config health in advance of a release linter_tests_main: name: Plugin Tests Main - # runs-on: [self-hosted, "${{ matrix.os }}"] TODO(Tyler): Set after Windows self-hosted are established. runs-on: ${{ matrix.os }} timeout-minutes: 120 strategy: fail-fast: false matrix: linter-version: [Snapshots, Latest] - os: [ubuntu-latest, macOS, windows-latest] + # TODO(Tyler): Re-add Windows runners. + os: [ubuntu-latest, macOS] steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -67,6 +67,7 @@ jobs: with: linter-version: ${{ matrix.linter-version }} ref-type: main + snyk-token: ${{ secrets.TRUNK_SNYK_TOKEN }} sourcery-token: ${{ secrets.TRUNK_SOURCERY_TOKEN }} trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} @@ -173,6 +174,7 @@ jobs: linter-version: ${{ matrix.linter-version }} append-args: linters -- --json --outputFile=${{ matrix.results-file }}-res.json ref-type: release + snyk-token: ${{ secrets.TRUNK_SNYK_TOKEN }} sourcery-token: ${{ secrets.TRUNK_SOURCERY_TOKEN }} trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} @@ -180,7 +182,7 @@ jobs: - name: Upload Test Outputs for Upload Job # Only upload results from latest. Always run, except when cancelled. if: (failure() || success()) && matrix.linter-version == 'Latest' - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: name: ${{ matrix.results-file }}-test-results path: ${{ matrix.results-file }}-res.json @@ -198,6 +200,7 @@ jobs: TRUNK_API_TOKEN: ${{ secrets.TRUNK_API_TOKEN }} TRUNK_OPEN_PR_APP_ID: ${{ secrets.TRUNK_OPEN_PR_APP_ID }} TRUNK_OPEN_PR_APP_PRIVATE_KEY: ${{ secrets.TRUNK_OPEN_PR_APP_PRIVATE_KEY }} + TRUNK_SNYK_TOKEN: ${{ secrets.TRUNK_SNYK_TOKEN }} TRUNK_SOURCERY_TOKEN: ${{ secrets.TRUNK_SOURCERY_TOKEN }} TRUNK_DEBUGGER_TOKEN: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} TRUNK_ORG_PROD_TOKEN: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} @@ -210,21 +213,21 @@ jobs: # Run tool tests only on main tool_tests_main: name: Tool Tests Main - # runs-on: [self-hosted, "${{ matrix.os }}"] TODO(Tyler): Set after Windows self-hosted are established. runs-on: ${{ matrix.os }} timeout-minutes: 120 strategy: fail-fast: false matrix: - os: [ubuntu-latest, macOS, windows-latest] + # TODO(Tyler): Re-add Windows runners. + os: [ubuntu-latest, macOS] include: # Normalize the filenames as inputs for ease of parsing - os: ubuntu-latest results-file: ubuntu-latest - os: macOS results-file: macos-latest - - os: windows-latest - results-file: windows-latest + # - os: windows-latest + # results-file: windows-latest steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -241,7 +244,7 @@ jobs: - name: Upload Test Outputs for Notification Job # Always run, except when cancelled. if: (failure() || success()) - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: name: tools-${{ matrix.results-file }}-test-results path: ${{ matrix.results-file }}-res.json @@ -254,6 +257,7 @@ jobs: uses: ./.github/workflows/upload_results.reusable.yaml secrets: TRUNKBOT_SLACK_BOT_TOKEN: ${{ secrets.TRUNKBOT_SLACK_BOT_TOKEN }} + TRUNK_SNYK_TOKEN: ${{ secrets.TRUNK_SNYK_TOKEN }} TRUNK_SOURCERY_TOKEN: ${{ secrets.TRUNK_SOURCERY_TOKEN }} TRUNK_DEBUGGER_TOKEN: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} TRUNK_ORG_PROD_TOKEN: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 0c007b2ea..3b5b72a1a 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -151,6 +151,7 @@ jobs: with: linter-version: KnownGoodVersion ref-type: main + snyk-token: ${{ secrets.TRUNK_SNYK_TOKEN }} sourcery-token: ${{ secrets.TRUNK_SOURCERY_TOKEN }} append-args: ${{ needs.detect_changes.outputs.all-linters }} ${{ @@ -167,6 +168,7 @@ jobs: with: linter-version: Latest ref-type: main + snyk-token: ${{ secrets.TRUNK_SNYK_TOKEN }} sourcery-token: ${{ secrets.TRUNK_SOURCERY_TOKEN }} append-args: ${{ needs.detect_changes.outputs.linters-files }} trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} @@ -239,12 +241,12 @@ jobs: TRUNK_GITHUB_CHECK_RUN_TITLE: Trunk Check # Run Windows tests for modified linters and tools - # TODO(Tyler): When this is more stabilized and we want to gate on it, we can make it part of the matrix above. windows_linter_tests: name: Windows Linter Tests runs-on: windows-latest needs: detect_changes - if: needs.detect_changes.outputs.linters == 'true' + # TODO(Tyler): Re-add Windows runners. + if: needs.detect_changes.outputs.linters == 'true' && false timeout-minutes: 90 steps: - name: Checkout @@ -262,17 +264,19 @@ jobs: with: linter-version: Latest ref-type: main + snyk-token: ${{ secrets.TRUNK_SNYK_TOKEN }} sourcery-token: ${{ secrets.TRUNK_SOURCERY_TOKEN }} cli-path: ${{ github.workspace }}\trunk.ps1 append-args: ${{needs.detect_changes.outputs.linters-files }} -- --maxWorkers=5 trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} + # TODO(Tyler): Re-add Windows runners. windows_tool_tests: name: Windows Tool Tests runs-on: windows-latest needs: detect_changes - if: needs.detect_changes.outputs.tools == 'true' + if: needs.detect_changes.outputs.tools == 'true' && false timeout-minutes: 60 steps: - name: Checkout diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index d475c3ce1..011b6861a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -57,7 +57,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: Upload artifact - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: name: SARIF file path: results.sarif @@ -65,6 +65,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: Upload to code-scanning - uses: github/codeql-action/upload-sarif@aa578102511db1f4524ed59b8cc2bae4f6e88195 # v3.27.6 + uses: github/codeql-action/upload-sarif@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5 with: sarif_file: results.sarif diff --git a/.github/workflows/upload_results.reusable.yaml b/.github/workflows/upload_results.reusable.yaml index 48230fec0..8e19d284f 100644 --- a/.github/workflows/upload_results.reusable.yaml +++ b/.github/workflows/upload_results.reusable.yaml @@ -34,6 +34,8 @@ on: required: false TRUNK_OPEN_PR_APP_PRIVATE_KEY: required: false + TRUNK_SNYK_TOKEN: + required: false TRUNK_SOURCERY_TOKEN: required: false TRUNK_DEBUGGER_TOKEN: @@ -74,12 +76,13 @@ jobs: with: name: ${{ inputs.results-prefix }}macos-latest-test-results - - name: Retrieve Test Outputs Windows - id: download-windows - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - continue-on-error: true - with: - name: ${{ inputs.results-prefix }}windows-latest-test-results + # TODO(Tyler): Re-add Windows runners. + # - name: Retrieve Test Outputs Windows + # id: download-windows + # uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 + # continue-on-error: true + # with: + # name: ${{ inputs.results-prefix }}windows-latest-test-results - name: Print Test Outputs continue-on-error: true @@ -93,15 +96,15 @@ jobs: cat "macos-latest-res.json" || echo "missing" echo "::endgroup::" - echo "::group::Windows results" - cat "windows-latest-res.json" || echo "missing" - echo "::endgroup::" + # echo "::group::Windows results" + # cat "windows-latest-res.json" || echo "missing" + # echo "::endgroup::" - name: Slack Notification For Missing Artifacts uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0 if: - steps.download-ubuntu.outcome == 'failure' || steps.download-macos.outcome == 'failure' || - steps.download-windows.outcome == 'failure' + steps.download-ubuntu.outcome == 'failure' || steps.download-macos.outcome == 'failure' + # || steps.download-windows.outcome == 'failure' with: method: chat.postMessage token: ${{ secrets.TRUNKBOT_SLACK_BOT_TOKEN }} @@ -112,7 +115,7 @@ jobs: - type: section text: type: mrkdwn - text: "Failure: " + text: "Failure: " - name: Setup Node uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 @@ -242,6 +245,7 @@ jobs: linter-version: Latest ref-type: main append-args: ${{ needs.upload_test_results.outputs.reruns }} -- -u + snyk-token: ${{ secrets.TRUNK_SNYK_TOKEN }} sourcery-token: ${{ secrets.TRUNK_SOURCERY_TOKEN }} trunk-staging-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} trunk-prod-token: ${{ secrets.TRUNK_ORG_PROD_TOKEN }} diff --git a/.github/workflows/windows_nightly.yaml b/.github/workflows/windows_nightly.yaml index 0f060ea7e..68ff0bb43 100644 --- a/.github/workflows/windows_nightly.yaml +++ b/.github/workflows/windows_nightly.yaml @@ -45,6 +45,7 @@ jobs: with: linter-version: ${{ matrix.linter-version }} ref-type: main + snyk-token: ${{ secrets.TRUNK_SNYK_TOKEN }} sourcery-token: ${{ secrets.TRUNK_SOURCERY_TOKEN }} cli-path: ${{ github.workspace }}\trunk.ps1 # manually specify more parallelism to avoid bottlenecks diff --git a/.gitignore b/.gitignore index 026fd7db3..75a65a35c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ node_modules/ out/ junit.xml + +# Snyk +.dccache diff --git a/README.md b/README.md index ad42f489a..d0545e841 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ trunk check enable {linter} | Ruby | [brakeman], [rubocop], [rufo], [semgrep], [standardrb] | | Rust | [clippy], [rustfmt] | | Scala | [scalafmt] | -| Security | [checkov], [dustilock], [nancy], [osv-scanner], [tfsec], [trivy], [trufflehog], [terrascan] | +| Security | [checkov], [dustilock], [nancy], [osv-scanner], [snyk], [tfsec], [trivy], [trufflehog], [terrascan] | | SQL | [sqlfluff], [sqlfmt], [sql-formatter], [squawk] | | SVG | [svgo] | | Swift | [stringslint], [swiftlint], [swiftformat] | @@ -175,6 +175,7 @@ trunk check enable {linter} [sqlfluff]: https://github.com/sqlfluff/sqlfluff#readme [sqlfmt]: https://github.com/tconbeer/sqlfmt#readme [squawk]: https://github.com/sbdchd/squawk#readme +[snyk]: https://github.com/snyk/cli#readme [standardrb]: https://github.com/testdouble/standard#readme [stringslint]: https://github.com/dral3x/StringsLint#readme [stylelint]: https://github.com/stylelint/stylelint#readme @@ -221,6 +222,7 @@ trunk actions enable {action} | [`go-mod-tidy-vendor`](actions/go-mod-tidy-vendor/README.md) | automatically tidy and vendor go.mod file | | [`git-blame-ignore-revs`](actions/git-blame-ignore-revs/README.md) | automatically configure git to use .git-blame-ignore-revs | | [`npm-check`](actions/npm-check/README.md) | check whether NPM installation is up to date | +| [`terraform-docs`](actions/terraform-docs/README.md) | generate documentation from Terraform modules | | [`poetry-check`](actions/poetry/README.md), [`poetry-lock`](actions/poetry/README.md), [`poetry-export`](actions/poetry/README.md), [`poetry-install`](actions/poetry/README.md) | hooks to enforce poetry configuration | | [`yarn-check`](actions/yarn-check/README.md) | check whether Yarn installation is up to date | diff --git a/actions/terraform-docs/README.md b/actions/terraform-docs/README.md new file mode 100644 index 000000000..39a43a3c4 --- /dev/null +++ b/actions/terraform-docs/README.md @@ -0,0 +1,13 @@ +# terraform-docs + +Generate documentation from Terraform modules in various output formats. Read more about +terraform-docs [here](https://terraform-docs.io). + +This action is intended to be used only with output mode as `inject` with `README.md` files as the +target. You can configure terraform-docs via a `.terraform-docs.yml` file at the root of your +repository. Read more about the configuration +[here](https://terraform-docs.io/user-guide/configuration/). + +Is markdownlint causing consistent diffs in your README files? Try using the < !-- +markdownlint-disable --> and < !-- markdownlint-enable --> comments to disable and re-enable +markdownlint for your terraform-docs section of your README. diff --git a/actions/terraform-docs/plugin.yaml b/actions/terraform-docs/plugin.yaml new file mode 100644 index 000000000..f18454a45 --- /dev/null +++ b/actions/terraform-docs/plugin.yaml @@ -0,0 +1,10 @@ +version: 0.1 +actions: + definitions: + - id: terraform-docs + display_name: Terraform Docs + description: Generate documentation from Terraform modules in various output formats + runtime: python + triggers: + - git_hooks: [pre-commit] + run: python3 ${cwd}/terraform-docs.py diff --git a/actions/terraform-docs/terraform-docs.py b/actions/terraform-docs/terraform-docs.py new file mode 100755 index 000000000..26f56ddb1 --- /dev/null +++ b/actions/terraform-docs/terraform-docs.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python3 +""" +Trunk.io plugin for terraform-docs integration. + +This script acts as a pre-commit hook to ensure terraform documentation is up to date. +It performs the following: +1. Runs terraform-docs to update documentation +2. Checks if any README.md files show up in the unstaged changes +3. Exits with failure if there are unstaged README changes, success otherwise +""" + +# trunk-ignore(bandit/B404) +import subprocess +import sys + + +def run_command(cmd): + """ + Execute a shell command and return its exit code, stdout, and stderr. + + Args: + cmd: List of command arguments to execute + + Returns: + Tuple containing (return_code, stdout, stderr) + """ + try: + + process = subprocess.Popen( + cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True, + # trunk-ignore(bandit/B603) + shell=False, # Explicitly disable shell to prevent command injection + ) + stdout, stderr = process.communicate() + return process.returncode, stdout, stderr + except FileNotFoundError: + print( + f"terraform-docs error: {cmd[0]} not found. Please ensure it's installed and in your PATH" + ) + sys.exit(1) + except Exception as e: + print(f"terraform-docs error: Executing command {' '.join(cmd)}: {e}") + sys.exit(1) + + +# First, run terraform-docs to update documentation +update_cmd = ["terraform-docs", "."] +return_code, stdout, stderr = run_command(update_cmd) + +if stderr: + print(f"terraform-docs error: Warning during execution:\n{stderr}", file=sys.stderr) + +# Check git status for unstaged README changes +status_cmd = ["git", "status", "--porcelain"] +return_code, stdout, stderr = run_command(status_cmd) + +# Look for any README.md files in the unstaged changes +unstaged_readmes = [ + line.split()[-1] + for line in stdout.splitlines() + if line.startswith(" M") and line.endswith("README.md") +] + +# Check if we found any unstaged README files +if len(unstaged_readmes) > 0: + print("terraform-docs error: Please stage any README changes before committing.") + sys.exit(1) + +print("terraform-docs: Documentation is up to date") +sys.exit(0) diff --git a/linters/ansible-lint/README.md b/linters/ansible-lint/README.md index 23be34fe1..2a6226784 100644 --- a/linters/ansible-lint/README.md +++ b/linters/ansible-lint/README.md @@ -2,10 +2,32 @@ ## Usage -[Ansible-lint](https://github.com/ansible/ansible-lint) is used to check ansible playbooks. In order -to integrate well with trunk, ansible is usually run using triggers. The trigger system allows file -changes to trigger lint runs. An example of an ansible-lint trigger is included below, but more -information can be found in our [docs](https://docs.trunk.io/check/configuration#trigger-rules). +### New Recommendation + +We now recommend using +[inverse ignores](https://docs.trunk.io/code-quality/linters/ignoring-issues-and-files#ignoring-multiple-files) +to run ansible-lint. For backwards compatibility, you will need to specify filetypes yourself and +then a list of ignores. + +```yaml +lint: + definitions: + - name: ansible-lint + files: [yaml] + enabled: + - ansible-lint@5.3.2 + ignore: + - linters: [ansible-lint] + paths: + - "**" + - "!test_data/jboss-standalone" +``` + +### Legacy Mode + +[Ansible-lint](https://github.com/ansible/ansible-lint) is used to check ansible playbooks. +Historically, in order to integrate well with trunk, you would invoke ansible-lint with +[triggers](https://docs.trunk.io/check/configuration#trigger-rules). ```yaml lint: diff --git a/linters/ansible-lint/ansible_lint.test.ts b/linters/ansible-lint/ansible_lint.test.ts index 896f5cba6..3510159b8 100644 --- a/linters/ansible-lint/ansible_lint.test.ts +++ b/linters/ansible-lint/ansible_lint.test.ts @@ -9,16 +9,14 @@ const preCheck = (driver: TrunkLintDriver) => { const trunkYamlPath = ".trunk/trunk.yaml"; const currentContents = driver.readFile(trunkYamlPath); - const newContents = currentContents.concat(` triggers: - # Run these linters - - linters: - - ansible-lint - # If any files matching these change + const newContents = currentContents.concat(` definitions: + - name: ansible-lint + files: [yaml] + ignore: + - linters: [ansible-lint] paths: - "**" - # On this target (A directory in this case) - targets: - - jboss-standalone + - "!jboss-standalone" `); driver.writeFile(trunkYamlPath, newContents); diff --git a/linters/ansible-lint/plugin.yaml b/linters/ansible-lint/plugin.yaml index 0e9caec4d..d7188d1b0 100644 --- a/linters/ansible-lint/plugin.yaml +++ b/linters/ansible-lint/plugin.yaml @@ -19,18 +19,20 @@ lint: version: ">=6.1.0" # sarif support was added in version 6.1.0 output: sarif - run: ansible-lint -f sarif + run: ansible-lint -f sarif ${target} # ansible-lint >=6.15.0 return exit code 5 when no files matched success_codes: [0, 2, 5] - run_from: ${target_directory} + run_from: ${parent} + batch: true - name: lint version: ">=5.1.3" # Custom parser type defined in the trunk cli to handle ansible-lint's output. output: ansible_lint # parseable-severity was removed after 5.4.0 - run: ansible-lint --parseable-severity + run: ansible-lint --parseable-severity ${target} success_codes: [0, 2] - run_from: ${target_directory} + run_from: ${parent} + batch: true tools: [ansible-lint] suggest_if: never direct_configs: [.ansible-lint] diff --git a/linters/ansible-lint/test_data/ansible_lint_v24.5.0_FQCN.check.shot b/linters/ansible-lint/test_data/ansible_lint_v24.5.0_FQCN.check.shot deleted file mode 100644 index ed073c421..000000000 --- a/linters/ansible-lint/test_data/ansible_lint_v24.5.0_FQCN.check.shot +++ /dev/null @@ -1,596 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP -// trunk-upgrade-validation:RELEASE - -exports[`Testing linter ansible-lint test FQCN 1`] = ` -{ - "issues": [ - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/demo-aws-launch.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "28", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.wait_for\` or \`ansible.legacy.wait_for\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/demo-aws-launch.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "5", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "name[play]", - "column": "1", - "file": "jboss-standalone/deploy-application.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[play]", - "level": "LEVEL_HIGH", - "line": "4", - "linter": "ansible-lint", - "message": "All plays should be named.", - "targetType": "custom", - }, - { - "code": "role-name", - "column": "1", - "file": "jboss-standalone/roles/java-app", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#role-name", - "level": "LEVEL_HIGH", - "line": "1", - "linter": "ansible-lint", - "message": "Role name java-app does not match \`\`^[a-z][a-z0-9_]*$\`\` pattern.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "14", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "14", - "linter": "ansible-lint", - "message": "Task/Handler: Copy application WAR file to host", - "targetType": "custom", - }, - { - "code": "fqcn[action]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action]", - "level": "LEVEL_HIGH", - "line": "19", - "linter": "ansible-lint", - "message": "Action \`jboss\` is not FQCN.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Task/Handler: Copy application WAR file to host", - "targetType": "custom", - }, - { - "code": "fqcn[action]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action]", - "level": "LEVEL_HIGH", - "line": "7", - "linter": "ansible-lint", - "message": "Action \`jboss\` is not FQCN.", - "targetType": "custom", - }, - { - "code": "role-name", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#role-name", - "level": "LEVEL_HIGH", - "line": "1", - "linter": "ansible-lint", - "message": "Role name jboss-standalone does not match \`\`^[a-z][a-z0-9_]*$\`\` pattern.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Task/Handler: restart jboss", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "7", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "7", - "linter": "ansible-lint", - "message": "Task/Handler: restart iptables", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "12", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.get_url\` or \`ansible.legacy.get_url\` instead.", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "12", - "linter": "ansible-lint", - "message": "Task/Handler: Download JBoss from jboss.org", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "17", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.unarchive\` or \`ansible.legacy.unarchive\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.dnf\` or \`ansible.legacy.dnf\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "22", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "25", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.command\` or \`ansible.legacy.command\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "31", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.template\` or \`ansible.legacy.template\` instead.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "31", - "linter": "ansible-lint", - "message": "Task/Handler: Copying standalone.xml configuration file", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "31", - "linter": "ansible-lint", - "message": "Task/Handler: Copying standalone.xml configuration file", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "37", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.group\` or \`ansible.legacy.group\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "41", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.user\` or \`ansible.legacy.user\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "47", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.file\` or \`ansible.legacy.file\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "53", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "55", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[octal-values]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[octal-values]", - "level": "LEVEL_HIGH", - "line": "59", - "linter": "ansible-lint", - "message": "Forbidden implicit octal value "0755"", - "targetType": "custom", - }, - { - "code": "command-instead-of-module", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#command-instead-of-module", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.shell\` or \`ansible.legacy.shell\` instead.", - "targetType": "custom", - }, - { - "code": "ignore-errors", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#ignore-errors", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", - }, - { - "code": "no-changed-when", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#no-changed-when", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "63", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "65", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "68", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "71", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.template\` or \`ansible.legacy.template\` instead.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "71", - "linter": "ansible-lint", - "message": "Task/Handler: deploy iptables rules", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "71", - "linter": "ansible-lint", - "message": "Task/Handler: deploy iptables rules", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "78", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.dnf\` or \`ansible.legacy.dnf\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "84", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action]", - "level": "LEVEL_HIGH", - "line": "90", - "linter": "ansible-lint", - "message": "Action \`firewalld\` is not FQCN.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "90", - "linter": "ansible-lint", - "message": "Task/Handler: deploy firewalld rules", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "92", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "95", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "name[play]", - "column": "1", - "file": "jboss-standalone/site.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[play]", - "level": "LEVEL_HIGH", - "line": "4", - "linter": "ansible-lint", - "message": "All plays should be named.", - "targetType": "custom", - }, - ], - "lintActions": [ - { - "command": "lint", - "fileGroupName": "custom", - "linter": "ansible-lint", - "paths": [ - "jboss-standalone", - ], - "verb": "TRUNK_VERB_CHECK", - }, - { - "command": "lint", - "fileGroupName": "custom", - "linter": "ansible-lint", - "paths": [ - "jboss-standalone", - ], - "upstream": true, - "verb": "TRUNK_VERB_CHECK", - }, - ], - "taskFailures": [], - "unformattedFiles": [], -} -`; diff --git a/linters/ansible-lint/test_data/ansible_lint_v24.5.0_non_FQCN.check.shot b/linters/ansible-lint/test_data/ansible_lint_v24.5.0_non_FQCN.check.shot deleted file mode 100644 index 5eb027aa2..000000000 --- a/linters/ansible-lint/test_data/ansible_lint_v24.5.0_non_FQCN.check.shot +++ /dev/null @@ -1,584 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP -// trunk-upgrade-validation:RELEASE - -exports[`Testing linter ansible-lint test non_FQCN 1`] = ` -{ - "issues": [ - { - "code": "syntax-check[unknown-module]", - "column": "7", - "file": "jboss-standalone/demo-aws-launch.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#syntax-check[unknown-module]", - "level": "LEVEL_HIGH", - "line": "12", - "linter": "ansible-lint", - "message": "couldn't resolve module/action 'ec2'. This often indicates a misspelling, missing collection, or incorrect module path.", - "targetType": "custom", - }, - { - "code": "name[play]", - "column": "1", - "file": "jboss-standalone/deploy-application.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[play]", - "level": "LEVEL_HIGH", - "line": "4", - "linter": "ansible-lint", - "message": "All plays should be named.", - "targetType": "custom", - }, - { - "code": "role-name", - "column": "1", - "file": "jboss-standalone/roles/java-app", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#role-name", - "level": "LEVEL_HIGH", - "line": "1", - "linter": "ansible-lint", - "message": "Role name java-app does not match \`\`^[a-z][a-z0-9_]*$\`\` pattern.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "14", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "14", - "linter": "ansible-lint", - "message": "Task/Handler: Copy application WAR file to host", - "targetType": "custom", - }, - { - "code": "fqcn[action]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action]", - "level": "LEVEL_HIGH", - "line": "19", - "linter": "ansible-lint", - "message": "Action \`jboss\` is not FQCN.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Task/Handler: Copy application WAR file to host", - "targetType": "custom", - }, - { - "code": "fqcn[action]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action]", - "level": "LEVEL_HIGH", - "line": "7", - "linter": "ansible-lint", - "message": "Action \`jboss\` is not FQCN.", - "targetType": "custom", - }, - { - "code": "role-name", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#role-name", - "level": "LEVEL_HIGH", - "line": "1", - "linter": "ansible-lint", - "message": "Role name jboss-standalone does not match \`\`^[a-z][a-z0-9_]*$\`\` pattern.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Task/Handler: restart jboss", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "7", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "7", - "linter": "ansible-lint", - "message": "Task/Handler: restart iptables", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "12", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.get_url\` or \`ansible.legacy.get_url\` instead.", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "12", - "linter": "ansible-lint", - "message": "Task/Handler: Download JBoss from jboss.org", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "17", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.unarchive\` or \`ansible.legacy.unarchive\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.dnf\` or \`ansible.legacy.dnf\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "22", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "25", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.command\` or \`ansible.legacy.command\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "31", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.template\` or \`ansible.legacy.template\` instead.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "31", - "linter": "ansible-lint", - "message": "Task/Handler: Copying standalone.xml configuration file", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "31", - "linter": "ansible-lint", - "message": "Task/Handler: Copying standalone.xml configuration file", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "37", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.group\` or \`ansible.legacy.group\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "41", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.user\` or \`ansible.legacy.user\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "47", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.file\` or \`ansible.legacy.file\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "53", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "55", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[octal-values]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[octal-values]", - "level": "LEVEL_HIGH", - "line": "59", - "linter": "ansible-lint", - "message": "Forbidden implicit octal value "0755"", - "targetType": "custom", - }, - { - "code": "command-instead-of-module", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#command-instead-of-module", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.shell\` or \`ansible.legacy.shell\` instead.", - "targetType": "custom", - }, - { - "code": "ignore-errors", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#ignore-errors", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", - }, - { - "code": "no-changed-when", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#no-changed-when", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "63", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "65", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "68", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "71", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.template\` or \`ansible.legacy.template\` instead.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "71", - "linter": "ansible-lint", - "message": "Task/Handler: deploy iptables rules", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "71", - "linter": "ansible-lint", - "message": "Task/Handler: deploy iptables rules", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "78", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.dnf\` or \`ansible.legacy.dnf\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "84", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action]", - "level": "LEVEL_HIGH", - "line": "90", - "linter": "ansible-lint", - "message": "Action \`firewalld\` is not FQCN.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "90", - "linter": "ansible-lint", - "message": "Task/Handler: deploy firewalld rules", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "92", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "95", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "name[play]", - "column": "1", - "file": "jboss-standalone/site.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[play]", - "level": "LEVEL_HIGH", - "line": "4", - "linter": "ansible-lint", - "message": "All plays should be named.", - "targetType": "custom", - }, - ], - "lintActions": [ - { - "command": "lint", - "fileGroupName": "custom", - "linter": "ansible-lint", - "paths": [ - "jboss-standalone", - ], - "verb": "TRUNK_VERB_CHECK", - }, - { - "command": "lint", - "fileGroupName": "custom", - "linter": "ansible-lint", - "paths": [ - "jboss-standalone", - ], - "upstream": true, - "verb": "TRUNK_VERB_CHECK", - }, - ], - "taskFailures": [], - "unformattedFiles": [], -} -`; diff --git a/linters/ansible-lint/test_data/ansible_lint_v24.6.0_FQCN.check.shot b/linters/ansible-lint/test_data/ansible_lint_v24.6.0_FQCN.check.shot index 90ea69641..a67527fe7 100644 --- a/linters/ansible-lint/test_data/ansible_lint_v24.6.0_FQCN.check.shot +++ b/linters/ansible-lint/test_data/ansible_lint_v24.6.0_FQCN.check.shot @@ -1,5 +1,4 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -// trunk-upgrade-validation:RELEASE exports[`Testing linter ansible-lint test FQCN 1`] = ` { @@ -14,7 +13,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "28", "linter": "ansible-lint", "message": "Use \`ansible.builtin.wait_for\` or \`ansible.legacy.wait_for\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -26,7 +25,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "5", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[play]", @@ -38,19 +37,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "4", "linter": "ansible-lint", "message": "All plays should be named.", - "targetType": "custom", - }, - { - "code": "role-name", - "column": "1", - "file": "jboss-standalone/roles/java-app", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#role-name", - "level": "LEVEL_HIGH", - "line": "1", - "linter": "ansible-lint", - "message": "Role name java-app does not match \`\`^[a-z][a-z0-9_]*$\`\` pattern.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -62,7 +49,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "14", "linter": "ansible-lint", "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "risky-file-permissions", @@ -74,7 +61,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "14", "linter": "ansible-lint", "message": "Task/Handler: Copy application WAR file to host", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action]", @@ -86,7 +73,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "19", "linter": "ansible-lint", "message": "Action \`jboss\` is not FQCN.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -98,7 +85,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "2", "linter": "ansible-lint", "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "risky-file-permissions", @@ -110,7 +97,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "2", "linter": "ansible-lint", "message": "Task/Handler: Copy application WAR file to host", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action]", @@ -122,19 +109,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "7", "linter": "ansible-lint", "message": "Action \`jboss\` is not FQCN.", - "targetType": "custom", - }, - { - "code": "role-name", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#role-name", - "level": "LEVEL_HIGH", - "line": "1", - "linter": "ansible-lint", - "message": "Role name jboss-standalone does not match \`\`^[a-z][a-z0-9_]*$\`\` pattern.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -146,7 +121,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "2", "linter": "ansible-lint", "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[casing]", @@ -158,7 +133,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "2", "linter": "ansible-lint", "message": "Task/Handler: restart jboss", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -170,7 +145,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "7", "linter": "ansible-lint", "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[casing]", @@ -182,7 +157,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "7", "linter": "ansible-lint", "message": "Task/Handler: restart iptables", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -194,7 +169,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "12", "linter": "ansible-lint", "message": "Use \`ansible.builtin.get_url\` or \`ansible.legacy.get_url\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "risky-file-permissions", @@ -206,7 +181,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "12", "linter": "ansible-lint", "message": "Task/Handler: Download JBoss from jboss.org", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -218,7 +193,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "17", "linter": "ansible-lint", "message": "Use \`ansible.builtin.unarchive\` or \`ansible.legacy.unarchive\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -230,7 +205,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "2", "linter": "ansible-lint", "message": "Use \`ansible.builtin.dnf\` or \`ansible.legacy.dnf\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -242,7 +217,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "22", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -254,7 +229,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "25", "linter": "ansible-lint", "message": "Use \`ansible.builtin.command\` or \`ansible.legacy.command\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -266,7 +241,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "31", "linter": "ansible-lint", "message": "Use \`ansible.builtin.template\` or \`ansible.legacy.template\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "risky-file-permissions", @@ -278,7 +253,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "31", "linter": "ansible-lint", "message": "Task/Handler: Copying standalone.xml configuration file", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -290,7 +265,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "37", "linter": "ansible-lint", "message": "Use \`ansible.builtin.group\` or \`ansible.legacy.group\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -302,7 +277,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "41", "linter": "ansible-lint", "message": "Use \`ansible.builtin.user\` or \`ansible.legacy.user\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -314,7 +289,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "47", "linter": "ansible-lint", "message": "Use \`ansible.builtin.file\` or \`ansible.legacy.file\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -326,7 +301,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "53", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -338,7 +313,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "55", "linter": "ansible-lint", "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[octal-values]", @@ -350,7 +325,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "59", "linter": "ansible-lint", "message": "Forbidden implicit octal value "0755"", - "targetType": "custom", + "targetType": "yaml", }, { "code": "command-instead-of-module", @@ -362,7 +337,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "61", "linter": "ansible-lint", "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -374,7 +349,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "61", "linter": "ansible-lint", "message": "Use \`ansible.builtin.shell\` or \`ansible.legacy.shell\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "ignore-errors", @@ -386,7 +361,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "61", "linter": "ansible-lint", "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", + "targetType": "yaml", }, { "code": "no-changed-when", @@ -398,7 +373,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "61", "linter": "ansible-lint", "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -410,7 +385,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "63", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -422,7 +397,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "65", "linter": "ansible-lint", "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -434,7 +409,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "68", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -446,7 +421,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "71", "linter": "ansible-lint", "message": "Use \`ansible.builtin.template\` or \`ansible.legacy.template\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[casing]", @@ -458,7 +433,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "71", "linter": "ansible-lint", "message": "Task/Handler: deploy iptables rules", - "targetType": "custom", + "targetType": "yaml", }, { "code": "risky-file-permissions", @@ -470,7 +445,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "71", "linter": "ansible-lint", "message": "Task/Handler: deploy iptables rules", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -482,7 +457,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "78", "linter": "ansible-lint", "message": "Use \`ansible.builtin.dnf\` or \`ansible.legacy.dnf\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -494,7 +469,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "84", "linter": "ansible-lint", "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action]", @@ -506,7 +481,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "90", "linter": "ansible-lint", "message": "Action \`firewalld\` is not FQCN.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[casing]", @@ -518,7 +493,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "90", "linter": "ansible-lint", "message": "Task/Handler: deploy firewalld rules", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -530,7 +505,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "92", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -542,7 +517,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "95", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[play]", @@ -554,27 +529,62 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "4", "linter": "ansible-lint", "message": "All plays should be named.", - "targetType": "custom", + "targetType": "yaml", }, ], "lintActions": [ { "command": "lint", - "fileGroupName": "custom", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/demo-aws-launch.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/deploy-application.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/roles/java-app/tasks/main.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/roles/jboss-standalone/handlers/main.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", "linter": "ansible-lint", "paths": [ - "jboss-standalone", + "jboss-standalone/roles/jboss-standalone/tasks/main.yml", ], "verb": "TRUNK_VERB_CHECK", }, { "command": "lint", - "fileGroupName": "custom", + "fileGroupName": "yaml", "linter": "ansible-lint", "paths": [ - "jboss-standalone", + "jboss-standalone/site.yml", ], - "upstream": true, "verb": "TRUNK_VERB_CHECK", }, ], diff --git a/linters/ansible-lint/test_data/ansible_lint_v24.6.0_non_FQCN.check.shot b/linters/ansible-lint/test_data/ansible_lint_v24.6.0_non_FQCN.check.shot index 8737a2c44..50b3c44c4 100644 --- a/linters/ansible-lint/test_data/ansible_lint_v24.6.0_non_FQCN.check.shot +++ b/linters/ansible-lint/test_data/ansible_lint_v24.6.0_non_FQCN.check.shot @@ -1,5 +1,4 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -// trunk-upgrade-validation:RELEASE exports[`Testing linter ansible-lint test non_FQCN 1`] = ` { @@ -14,7 +13,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "12", "linter": "ansible-lint", "message": "couldn't resolve module/action 'ec2'. This often indicates a misspelling, missing collection, or incorrect module path.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[play]", @@ -26,19 +25,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "4", "linter": "ansible-lint", "message": "All plays should be named.", - "targetType": "custom", - }, - { - "code": "role-name", - "column": "1", - "file": "jboss-standalone/roles/java-app", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#role-name", - "level": "LEVEL_HIGH", - "line": "1", - "linter": "ansible-lint", - "message": "Role name java-app does not match \`\`^[a-z][a-z0-9_]*$\`\` pattern.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -50,7 +37,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "14", "linter": "ansible-lint", "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "risky-file-permissions", @@ -62,7 +49,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "14", "linter": "ansible-lint", "message": "Task/Handler: Copy application WAR file to host", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action]", @@ -74,7 +61,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "19", "linter": "ansible-lint", "message": "Action \`jboss\` is not FQCN.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -86,7 +73,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "2", "linter": "ansible-lint", "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "risky-file-permissions", @@ -98,7 +85,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "2", "linter": "ansible-lint", "message": "Task/Handler: Copy application WAR file to host", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action]", @@ -110,19 +97,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "7", "linter": "ansible-lint", "message": "Action \`jboss\` is not FQCN.", - "targetType": "custom", - }, - { - "code": "role-name", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#role-name", - "level": "LEVEL_HIGH", - "line": "1", - "linter": "ansible-lint", - "message": "Role name jboss-standalone does not match \`\`^[a-z][a-z0-9_]*$\`\` pattern.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -134,7 +109,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "2", "linter": "ansible-lint", "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[casing]", @@ -146,7 +121,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "2", "linter": "ansible-lint", "message": "Task/Handler: restart jboss", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -158,7 +133,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "7", "linter": "ansible-lint", "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[casing]", @@ -170,7 +145,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "7", "linter": "ansible-lint", "message": "Task/Handler: restart iptables", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -182,7 +157,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "12", "linter": "ansible-lint", "message": "Use \`ansible.builtin.get_url\` or \`ansible.legacy.get_url\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "risky-file-permissions", @@ -194,7 +169,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "12", "linter": "ansible-lint", "message": "Task/Handler: Download JBoss from jboss.org", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -206,7 +181,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "17", "linter": "ansible-lint", "message": "Use \`ansible.builtin.unarchive\` or \`ansible.legacy.unarchive\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -218,7 +193,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "2", "linter": "ansible-lint", "message": "Use \`ansible.builtin.dnf\` or \`ansible.legacy.dnf\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -230,7 +205,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "22", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -242,7 +217,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "25", "linter": "ansible-lint", "message": "Use \`ansible.builtin.command\` or \`ansible.legacy.command\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -254,7 +229,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "31", "linter": "ansible-lint", "message": "Use \`ansible.builtin.template\` or \`ansible.legacy.template\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "risky-file-permissions", @@ -266,7 +241,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "31", "linter": "ansible-lint", "message": "Task/Handler: Copying standalone.xml configuration file", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -278,7 +253,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "37", "linter": "ansible-lint", "message": "Use \`ansible.builtin.group\` or \`ansible.legacy.group\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -290,7 +265,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "41", "linter": "ansible-lint", "message": "Use \`ansible.builtin.user\` or \`ansible.legacy.user\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -302,7 +277,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "47", "linter": "ansible-lint", "message": "Use \`ansible.builtin.file\` or \`ansible.legacy.file\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -314,7 +289,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "53", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -326,7 +301,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "55", "linter": "ansible-lint", "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[octal-values]", @@ -338,7 +313,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "59", "linter": "ansible-lint", "message": "Forbidden implicit octal value "0755"", - "targetType": "custom", + "targetType": "yaml", }, { "code": "command-instead-of-module", @@ -350,7 +325,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "61", "linter": "ansible-lint", "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -362,7 +337,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "61", "linter": "ansible-lint", "message": "Use \`ansible.builtin.shell\` or \`ansible.legacy.shell\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "ignore-errors", @@ -374,7 +349,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "61", "linter": "ansible-lint", "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", + "targetType": "yaml", }, { "code": "no-changed-when", @@ -386,7 +361,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "61", "linter": "ansible-lint", "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -398,7 +373,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "63", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -410,7 +385,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "65", "linter": "ansible-lint", "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -422,7 +397,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "68", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -434,7 +409,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "71", "linter": "ansible-lint", "message": "Use \`ansible.builtin.template\` or \`ansible.legacy.template\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[casing]", @@ -446,7 +421,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "71", "linter": "ansible-lint", "message": "Task/Handler: deploy iptables rules", - "targetType": "custom", + "targetType": "yaml", }, { "code": "risky-file-permissions", @@ -458,7 +433,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "71", "linter": "ansible-lint", "message": "Task/Handler: deploy iptables rules", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -470,7 +445,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "78", "linter": "ansible-lint", "message": "Use \`ansible.builtin.dnf\` or \`ansible.legacy.dnf\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -482,7 +457,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "84", "linter": "ansible-lint", "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action]", @@ -494,7 +469,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "90", "linter": "ansible-lint", "message": "Action \`firewalld\` is not FQCN.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[casing]", @@ -506,7 +481,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "90", "linter": "ansible-lint", "message": "Task/Handler: deploy firewalld rules", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -518,7 +493,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "92", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -530,7 +505,7 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "95", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[play]", @@ -542,27 +517,62 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "4", "linter": "ansible-lint", "message": "All plays should be named.", - "targetType": "custom", + "targetType": "yaml", }, ], "lintActions": [ { "command": "lint", - "fileGroupName": "custom", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/demo-aws-launch.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/deploy-application.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/roles/java-app/tasks/main.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/roles/jboss-standalone/handlers/main.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", "linter": "ansible-lint", "paths": [ - "jboss-standalone", + "jboss-standalone/roles/jboss-standalone/tasks/main.yml", ], "verb": "TRUNK_VERB_CHECK", }, { "command": "lint", - "fileGroupName": "custom", + "fileGroupName": "yaml", "linter": "ansible-lint", "paths": [ - "jboss-standalone", + "jboss-standalone/site.yml", ], - "upstream": true, "verb": "TRUNK_VERB_CHECK", }, ], diff --git a/linters/ansible-lint/test_data/ansible_lint_v6.13.0_FQCN.check.shot b/linters/ansible-lint/test_data/ansible_lint_v6.13.0_FQCN.check.shot index 82f916454..2fc859ed5 100644 --- a/linters/ansible-lint/test_data/ansible_lint_v6.13.0_FQCN.check.shot +++ b/linters/ansible-lint/test_data/ansible_lint_v6.13.0_FQCN.check.shot @@ -1,5 +1,4 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -// trunk-upgrade-validation:RELEASE exports[`Testing linter ansible-lint test FQCN 1`] = ` { @@ -14,7 +13,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "28", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (wait_for).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -26,7 +25,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "5", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[play]", @@ -38,19 +37,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "4", "linter": "ansible-lint", "message": "All plays should be named.", - "targetType": "custom", - }, - { - "code": "role-name", - "column": "1", - "file": "jboss-standalone/roles/java-app", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#role-name", - "level": "LEVEL_HIGH", - "line": "1", - "linter": "ansible-lint", - "message": "Role name java-app does not match \`\`^[a-z][a-z0-9_]*$\`\` pattern.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -62,7 +49,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "14", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (copy).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "risky-file-permissions", @@ -74,7 +61,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "14", "linter": "ansible-lint", "message": "File permissions unset or incorrect.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action]", @@ -86,7 +73,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "19", "linter": "ansible-lint", "message": "Use FQCN for module actions, such \`community.general.jboss\`.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -98,7 +85,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "2", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (copy).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "risky-file-permissions", @@ -110,7 +97,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "2", "linter": "ansible-lint", "message": "File permissions unset or incorrect.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action]", @@ -122,19 +109,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "7", "linter": "ansible-lint", "message": "Use FQCN for module actions, such \`community.general.jboss\`.", - "targetType": "custom", - }, - { - "code": "role-name", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#role-name", - "level": "LEVEL_HIGH", - "line": "1", - "linter": "ansible-lint", - "message": "Role name jboss-standalone does not match \`\`^[a-z][a-z0-9_]*$\`\` pattern.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -146,7 +121,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "2", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (service).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[casing]", @@ -158,7 +133,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "2", "linter": "ansible-lint", "message": "All names should start with an uppercase letter.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -170,7 +145,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "7", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (service).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[casing]", @@ -182,7 +157,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "7", "linter": "ansible-lint", "message": "All names should start with an uppercase letter.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -194,7 +169,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "12", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (get_url).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "risky-file-permissions", @@ -206,7 +181,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "12", "linter": "ansible-lint", "message": "File permissions unset or incorrect.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -218,7 +193,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "17", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (unarchive).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -230,7 +205,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "22", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -242,7 +217,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "25", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (command).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -254,7 +229,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "31", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (template).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "risky-file-permissions", @@ -266,7 +241,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "31", "linter": "ansible-lint", "message": "File permissions unset or incorrect.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -278,7 +253,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "37", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (group).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -290,7 +265,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "41", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (user).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -302,7 +277,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "47", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (file).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -314,7 +289,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "53", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -326,7 +301,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "55", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (copy).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[octal-values]", @@ -338,7 +313,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "59", "linter": "ansible-lint", "message": "Forbidden implicit octal value "0755"", - "targetType": "custom", + "targetType": "yaml", }, { "code": "command-instead-of-module", @@ -350,7 +325,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "61", "linter": "ansible-lint", "message": "service used in place of service module", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -362,7 +337,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "61", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (shell).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "ignore-errors", @@ -374,7 +349,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "61", "linter": "ansible-lint", "message": "Use failed_when and specify error conditions instead of using ignore_errors.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "no-changed-when", @@ -386,7 +361,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "61", "linter": "ansible-lint", "message": "Commands should not change things if nothing needs doing.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -398,7 +373,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "63", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -410,7 +385,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "65", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (service).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -422,7 +397,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "68", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -434,7 +409,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "71", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (template).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[casing]", @@ -446,7 +421,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "71", "linter": "ansible-lint", "message": "All names should start with an uppercase letter.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "risky-file-permissions", @@ -458,7 +433,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "71", "linter": "ansible-lint", "message": "File permissions unset or incorrect.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action-core]", @@ -470,7 +445,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "84", "linter": "ansible-lint", "message": "Use FQCN for builtin module actions (service).", - "targetType": "custom", + "targetType": "yaml", }, { "code": "fqcn[action]", @@ -482,7 +457,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "90", "linter": "ansible-lint", "message": "Use FQCN for module actions, such \`ansible.posix.firewalld\`.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[casing]", @@ -494,7 +469,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "90", "linter": "ansible-lint", "message": "All names should start with an uppercase letter.", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -506,7 +481,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "92", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "yaml[truthy]", @@ -518,7 +493,7 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "95", "linter": "ansible-lint", "message": "Truthy value should be one of [false, true]", - "targetType": "custom", + "targetType": "yaml", }, { "code": "name[play]", @@ -530,27 +505,62 @@ exports[`Testing linter ansible-lint test FQCN 1`] = ` "line": "4", "linter": "ansible-lint", "message": "All plays should be named.", - "targetType": "custom", + "targetType": "yaml", }, ], "lintActions": [ { "command": "lint", - "fileGroupName": "custom", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/demo-aws-launch.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/deploy-application.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/roles/java-app/tasks/main.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/roles/jboss-standalone/handlers/main.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", "linter": "ansible-lint", "paths": [ - "jboss-standalone", + "jboss-standalone/roles/jboss-standalone/tasks/main.yml", ], "verb": "TRUNK_VERB_CHECK", }, { "command": "lint", - "fileGroupName": "custom", + "fileGroupName": "yaml", "linter": "ansible-lint", "paths": [ - "jboss-standalone", + "jboss-standalone/site.yml", ], - "upstream": true, "verb": "TRUNK_VERB_CHECK", }, ], diff --git a/linters/ansible-lint/test_data/ansible_lint_v6.13.0_non_FQCN.check.shot b/linters/ansible-lint/test_data/ansible_lint_v6.13.0_non_FQCN.check.shot index 8c4365b3b..b17ecea8b 100644 --- a/linters/ansible-lint/test_data/ansible_lint_v6.13.0_non_FQCN.check.shot +++ b/linters/ansible-lint/test_data/ansible_lint_v6.13.0_non_FQCN.check.shot @@ -13,27 +13,518 @@ exports[`Testing linter ansible-lint test non_FQCN 1`] = ` "line": "12", "linter": "ansible-lint", "message": "couldn't resolve module/action 'ec2'. This often indicates a misspelling, missing collection, or incorrect module path.", - "targetType": "custom", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/java-app/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "14", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (copy).", + "targetType": "yaml", + }, + { + "code": "risky-file-permissions", + "column": "1", + "file": "jboss-standalone/roles/java-app/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", + "level": "LEVEL_HIGH", + "line": "14", + "linter": "ansible-lint", + "message": "File permissions unset or incorrect.", + "targetType": "yaml", + }, + { + "code": "fqcn[action]", + "column": "1", + "file": "jboss-standalone/roles/java-app/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action]", + "level": "LEVEL_HIGH", + "line": "19", + "linter": "ansible-lint", + "message": "Use FQCN for module actions, such \`community.general.jboss\`.", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/java-app/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "2", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (copy).", + "targetType": "yaml", + }, + { + "code": "risky-file-permissions", + "column": "1", + "file": "jboss-standalone/roles/java-app/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", + "level": "LEVEL_HIGH", + "line": "2", + "linter": "ansible-lint", + "message": "File permissions unset or incorrect.", + "targetType": "yaml", + }, + { + "code": "fqcn[action]", + "column": "1", + "file": "jboss-standalone/roles/java-app/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action]", + "level": "LEVEL_HIGH", + "line": "7", + "linter": "ansible-lint", + "message": "Use FQCN for module actions, such \`community.general.jboss\`.", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "2", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (service).", + "targetType": "yaml", + }, + { + "code": "name[casing]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", + "level": "LEVEL_HIGH", + "line": "2", + "linter": "ansible-lint", + "message": "All names should start with an uppercase letter.", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "7", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (service).", + "targetType": "yaml", + }, + { + "code": "name[casing]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", + "level": "LEVEL_HIGH", + "line": "7", + "linter": "ansible-lint", + "message": "All names should start with an uppercase letter.", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "12", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (get_url).", + "targetType": "yaml", + }, + { + "code": "risky-file-permissions", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", + "level": "LEVEL_HIGH", + "line": "12", + "linter": "ansible-lint", + "message": "File permissions unset or incorrect.", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "17", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (unarchive).", + "targetType": "yaml", + }, + { + "code": "yaml[truthy]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", + "level": "LEVEL_HIGH", + "line": "22", + "linter": "ansible-lint", + "message": "Truthy value should be one of [false, true]", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "25", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (command).", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "31", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (template).", + "targetType": "yaml", + }, + { + "code": "risky-file-permissions", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", + "level": "LEVEL_HIGH", + "line": "31", + "linter": "ansible-lint", + "message": "File permissions unset or incorrect.", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "37", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (group).", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "41", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (user).", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "47", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (file).", + "targetType": "yaml", + }, + { + "code": "yaml[truthy]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", + "level": "LEVEL_HIGH", + "line": "53", + "linter": "ansible-lint", + "message": "Truthy value should be one of [false, true]", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "55", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (copy).", + "targetType": "yaml", + }, + { + "code": "yaml[octal-values]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[octal-values]", + "level": "LEVEL_HIGH", + "line": "59", + "linter": "ansible-lint", + "message": "Forbidden implicit octal value "0755"", + "targetType": "yaml", + }, + { + "code": "command-instead-of-module", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#command-instead-of-module", + "level": "LEVEL_HIGH", + "line": "61", + "linter": "ansible-lint", + "message": "service used in place of service module", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "61", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (shell).", + "targetType": "yaml", + }, + { + "code": "ignore-errors", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#ignore-errors", + "level": "LEVEL_HIGH", + "line": "61", + "linter": "ansible-lint", + "message": "Use failed_when and specify error conditions instead of using ignore_errors.", + "targetType": "yaml", + }, + { + "code": "no-changed-when", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#no-changed-when", + "level": "LEVEL_HIGH", + "line": "61", + "linter": "ansible-lint", + "message": "Commands should not change things if nothing needs doing.", + "targetType": "yaml", + }, + { + "code": "yaml[truthy]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", + "level": "LEVEL_HIGH", + "line": "63", + "linter": "ansible-lint", + "message": "Truthy value should be one of [false, true]", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "65", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (service).", + "targetType": "yaml", + }, + { + "code": "yaml[truthy]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", + "level": "LEVEL_HIGH", + "line": "68", + "linter": "ansible-lint", + "message": "Truthy value should be one of [false, true]", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "71", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (template).", + "targetType": "yaml", + }, + { + "code": "name[casing]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", + "level": "LEVEL_HIGH", + "line": "71", + "linter": "ansible-lint", + "message": "All names should start with an uppercase letter.", + "targetType": "yaml", + }, + { + "code": "risky-file-permissions", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", + "level": "LEVEL_HIGH", + "line": "71", + "linter": "ansible-lint", + "message": "File permissions unset or incorrect.", + "targetType": "yaml", + }, + { + "code": "fqcn[action-core]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", + "level": "LEVEL_HIGH", + "line": "84", + "linter": "ansible-lint", + "message": "Use FQCN for builtin module actions (service).", + "targetType": "yaml", + }, + { + "code": "fqcn[action]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action]", + "level": "LEVEL_HIGH", + "line": "90", + "linter": "ansible-lint", + "message": "Use FQCN for module actions, such \`ansible.posix.firewalld\`.", + "targetType": "yaml", + }, + { + "code": "name[casing]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", + "level": "LEVEL_HIGH", + "line": "90", + "linter": "ansible-lint", + "message": "All names should start with an uppercase letter.", + "targetType": "yaml", + }, + { + "code": "yaml[truthy]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", + "level": "LEVEL_HIGH", + "line": "92", + "linter": "ansible-lint", + "message": "Truthy value should be one of [false, true]", + "targetType": "yaml", + }, + { + "code": "yaml[truthy]", + "column": "1", + "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", + "level": "LEVEL_HIGH", + "line": "95", + "linter": "ansible-lint", + "message": "Truthy value should be one of [false, true]", + "targetType": "yaml", }, ], "lintActions": [ { "command": "lint", - "fileGroupName": "custom", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/demo-aws-launch.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/deploy-application.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/roles/java-app/tasks/main.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", + "linter": "ansible-lint", + "paths": [ + "jboss-standalone/roles/jboss-standalone/handlers/main.yml", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "yaml", "linter": "ansible-lint", "paths": [ - "jboss-standalone", + "jboss-standalone/roles/jboss-standalone/tasks/main.yml", ], "verb": "TRUNK_VERB_CHECK", }, { "command": "lint", - "fileGroupName": "custom", + "fileGroupName": "yaml", "linter": "ansible-lint", "paths": [ - "jboss-standalone", + "jboss-standalone/site.yml", ], - "upstream": true, "verb": "TRUNK_VERB_CHECK", }, ], diff --git a/linters/ansible-lint/test_data/ansible_lint_v6.14.3_FQCN.check.shot b/linters/ansible-lint/test_data/ansible_lint_v6.14.3_FQCN.check.shot deleted file mode 100644 index 21551177a..000000000 --- a/linters/ansible-lint/test_data/ansible_lint_v6.14.3_FQCN.check.shot +++ /dev/null @@ -1,560 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP -// trunk-upgrade-validation:RELEASE - -exports[`Testing linter ansible-lint test FQCN 1`] = ` -{ - "issues": [ - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/demo-aws-launch.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "28", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.wait_for\` or \`ansible.legacy.wait_for\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/demo-aws-launch.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "5", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "name[play]", - "column": "1", - "file": "jboss-standalone/deploy-application.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[play]", - "level": "LEVEL_HIGH", - "line": "4", - "linter": "ansible-lint", - "message": "All plays should be named.", - "targetType": "custom", - }, - { - "code": "role-name", - "column": "1", - "file": "jboss-standalone/roles/java-app", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#role-name", - "level": "LEVEL_HIGH", - "line": "1", - "linter": "ansible-lint", - "message": "Role name java-app does not match \`\`^[a-z][a-z0-9_]*$\`\` pattern.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "14", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "14", - "linter": "ansible-lint", - "message": "Task/Handler: Copy application WAR file to host", - "targetType": "custom", - }, - { - "code": "fqcn[action]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action]", - "level": "LEVEL_HIGH", - "line": "19", - "linter": "ansible-lint", - "message": "Action \`jboss\` is not FQCN.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Task/Handler: Copy application WAR file to host", - "targetType": "custom", - }, - { - "code": "fqcn[action]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action]", - "level": "LEVEL_HIGH", - "line": "7", - "linter": "ansible-lint", - "message": "Action \`jboss\` is not FQCN.", - "targetType": "custom", - }, - { - "code": "role-name", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#role-name", - "level": "LEVEL_HIGH", - "line": "1", - "linter": "ansible-lint", - "message": "Role name jboss-standalone does not match \`\`^[a-z][a-z0-9_]*$\`\` pattern.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Task/Handler: restart jboss", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "7", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "7", - "linter": "ansible-lint", - "message": "Task/Handler: restart iptables", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "12", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.get_url\` or \`ansible.legacy.get_url\` instead.", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "12", - "linter": "ansible-lint", - "message": "Task/Handler: Download JBoss from jboss.org", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "17", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.unarchive\` or \`ansible.legacy.unarchive\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "22", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "25", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.command\` or \`ansible.legacy.command\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "31", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.template\` or \`ansible.legacy.template\` instead.", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "31", - "linter": "ansible-lint", - "message": "Task/Handler: Copying standalone.xml configuration file", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "37", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.group\` or \`ansible.legacy.group\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "41", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.user\` or \`ansible.legacy.user\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "47", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.file\` or \`ansible.legacy.file\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "53", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "55", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[octal-values]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[octal-values]", - "level": "LEVEL_HIGH", - "line": "59", - "linter": "ansible-lint", - "message": "Forbidden implicit octal value "0755"", - "targetType": "custom", - }, - { - "code": "command-instead-of-module", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#command-instead-of-module", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.shell\` or \`ansible.legacy.shell\` instead.", - "targetType": "custom", - }, - { - "code": "ignore-errors", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#ignore-errors", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", - }, - { - "code": "no-changed-when", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#no-changed-when", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "63", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "65", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "68", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "71", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.template\` or \`ansible.legacy.template\` instead.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "71", - "linter": "ansible-lint", - "message": "Task/Handler: deploy iptables rules", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "71", - "linter": "ansible-lint", - "message": "Task/Handler: deploy iptables rules", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "84", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action]", - "level": "LEVEL_HIGH", - "line": "90", - "linter": "ansible-lint", - "message": "Action \`firewalld\` is not FQCN.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "90", - "linter": "ansible-lint", - "message": "Task/Handler: deploy firewalld rules", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "92", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "95", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "name[play]", - "column": "1", - "file": "jboss-standalone/site.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[play]", - "level": "LEVEL_HIGH", - "line": "4", - "linter": "ansible-lint", - "message": "All plays should be named.", - "targetType": "custom", - }, - ], - "lintActions": [ - { - "command": "lint", - "fileGroupName": "custom", - "linter": "ansible-lint", - "paths": [ - "jboss-standalone", - ], - "verb": "TRUNK_VERB_CHECK", - }, - { - "command": "lint", - "fileGroupName": "custom", - "linter": "ansible-lint", - "paths": [ - "jboss-standalone", - ], - "upstream": true, - "verb": "TRUNK_VERB_CHECK", - }, - ], - "taskFailures": [], - "unformattedFiles": [], -} -`; diff --git a/linters/ansible-lint/test_data/ansible_lint_v6.14.3_non_FQCN.check.shot b/linters/ansible-lint/test_data/ansible_lint_v6.14.3_non_FQCN.check.shot deleted file mode 100644 index 8c4365b3b..000000000 --- a/linters/ansible-lint/test_data/ansible_lint_v6.14.3_non_FQCN.check.shot +++ /dev/null @@ -1,43 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Testing linter ansible-lint test non_FQCN 1`] = ` -{ - "issues": [ - { - "code": "syntax-check[specific]", - "column": "7", - "file": "jboss-standalone/demo-aws-launch.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#syntax-check[specific]", - "level": "LEVEL_HIGH", - "line": "12", - "linter": "ansible-lint", - "message": "couldn't resolve module/action 'ec2'. This often indicates a misspelling, missing collection, or incorrect module path.", - "targetType": "custom", - }, - ], - "lintActions": [ - { - "command": "lint", - "fileGroupName": "custom", - "linter": "ansible-lint", - "paths": [ - "jboss-standalone", - ], - "verb": "TRUNK_VERB_CHECK", - }, - { - "command": "lint", - "fileGroupName": "custom", - "linter": "ansible-lint", - "paths": [ - "jboss-standalone", - ], - "upstream": true, - "verb": "TRUNK_VERB_CHECK", - }, - ], - "taskFailures": [], - "unformattedFiles": [], -} -`; diff --git a/linters/ansible-lint/test_data/ansible_lint_v6.22.1_FQCN.check.shot b/linters/ansible-lint/test_data/ansible_lint_v6.22.1_FQCN.check.shot deleted file mode 100644 index 21551177a..000000000 --- a/linters/ansible-lint/test_data/ansible_lint_v6.22.1_FQCN.check.shot +++ /dev/null @@ -1,560 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP -// trunk-upgrade-validation:RELEASE - -exports[`Testing linter ansible-lint test FQCN 1`] = ` -{ - "issues": [ - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/demo-aws-launch.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "28", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.wait_for\` or \`ansible.legacy.wait_for\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/demo-aws-launch.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "5", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "name[play]", - "column": "1", - "file": "jboss-standalone/deploy-application.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[play]", - "level": "LEVEL_HIGH", - "line": "4", - "linter": "ansible-lint", - "message": "All plays should be named.", - "targetType": "custom", - }, - { - "code": "role-name", - "column": "1", - "file": "jboss-standalone/roles/java-app", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#role-name", - "level": "LEVEL_HIGH", - "line": "1", - "linter": "ansible-lint", - "message": "Role name java-app does not match \`\`^[a-z][a-z0-9_]*$\`\` pattern.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "14", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "14", - "linter": "ansible-lint", - "message": "Task/Handler: Copy application WAR file to host", - "targetType": "custom", - }, - { - "code": "fqcn[action]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action]", - "level": "LEVEL_HIGH", - "line": "19", - "linter": "ansible-lint", - "message": "Action \`jboss\` is not FQCN.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Task/Handler: Copy application WAR file to host", - "targetType": "custom", - }, - { - "code": "fqcn[action]", - "column": "1", - "file": "jboss-standalone/roles/java-app/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action]", - "level": "LEVEL_HIGH", - "line": "7", - "linter": "ansible-lint", - "message": "Action \`jboss\` is not FQCN.", - "targetType": "custom", - }, - { - "code": "role-name", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#role-name", - "level": "LEVEL_HIGH", - "line": "1", - "linter": "ansible-lint", - "message": "Role name jboss-standalone does not match \`\`^[a-z][a-z0-9_]*$\`\` pattern.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "2", - "linter": "ansible-lint", - "message": "Task/Handler: restart jboss", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "7", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/handlers/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "7", - "linter": "ansible-lint", - "message": "Task/Handler: restart iptables", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "12", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.get_url\` or \`ansible.legacy.get_url\` instead.", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "12", - "linter": "ansible-lint", - "message": "Task/Handler: Download JBoss from jboss.org", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "17", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.unarchive\` or \`ansible.legacy.unarchive\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "22", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "25", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.command\` or \`ansible.legacy.command\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "31", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.template\` or \`ansible.legacy.template\` instead.", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "31", - "linter": "ansible-lint", - "message": "Task/Handler: Copying standalone.xml configuration file", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "37", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.group\` or \`ansible.legacy.group\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "41", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.user\` or \`ansible.legacy.user\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "47", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.file\` or \`ansible.legacy.file\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "53", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "55", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.copy\` or \`ansible.legacy.copy\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[octal-values]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[octal-values]", - "level": "LEVEL_HIGH", - "line": "59", - "linter": "ansible-lint", - "message": "Forbidden implicit octal value "0755"", - "targetType": "custom", - }, - { - "code": "command-instead-of-module", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#command-instead-of-module", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.shell\` or \`ansible.legacy.shell\` instead.", - "targetType": "custom", - }, - { - "code": "ignore-errors", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#ignore-errors", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", - }, - { - "code": "no-changed-when", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#no-changed-when", - "level": "LEVEL_HIGH", - "line": "61", - "linter": "ansible-lint", - "message": "Task/Handler: Workaround for systemd bug", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "63", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "65", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "68", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "71", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.template\` or \`ansible.legacy.template\` instead.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "71", - "linter": "ansible-lint", - "message": "Task/Handler: deploy iptables rules", - "targetType": "custom", - }, - { - "code": "risky-file-permissions", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#risky-file-permissions", - "level": "LEVEL_HIGH", - "line": "71", - "linter": "ansible-lint", - "message": "Task/Handler: deploy iptables rules", - "targetType": "custom", - }, - { - "code": "fqcn[action-core]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action-core]", - "level": "LEVEL_HIGH", - "line": "84", - "linter": "ansible-lint", - "message": "Use \`ansible.builtin.service\` or \`ansible.legacy.service\` instead.", - "targetType": "custom", - }, - { - "code": "fqcn[action]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#fqcn[action]", - "level": "LEVEL_HIGH", - "line": "90", - "linter": "ansible-lint", - "message": "Action \`firewalld\` is not FQCN.", - "targetType": "custom", - }, - { - "code": "name[casing]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[casing]", - "level": "LEVEL_HIGH", - "line": "90", - "linter": "ansible-lint", - "message": "Task/Handler: deploy firewalld rules", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "92", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "yaml[truthy]", - "column": "1", - "file": "jboss-standalone/roles/jboss-standalone/tasks/main.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#yaml[truthy]", - "level": "LEVEL_HIGH", - "line": "95", - "linter": "ansible-lint", - "message": "Truthy value should be one of [false, true]", - "targetType": "custom", - }, - { - "code": "name[play]", - "column": "1", - "file": "jboss-standalone/site.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#name[play]", - "level": "LEVEL_HIGH", - "line": "4", - "linter": "ansible-lint", - "message": "All plays should be named.", - "targetType": "custom", - }, - ], - "lintActions": [ - { - "command": "lint", - "fileGroupName": "custom", - "linter": "ansible-lint", - "paths": [ - "jboss-standalone", - ], - "verb": "TRUNK_VERB_CHECK", - }, - { - "command": "lint", - "fileGroupName": "custom", - "linter": "ansible-lint", - "paths": [ - "jboss-standalone", - ], - "upstream": true, - "verb": "TRUNK_VERB_CHECK", - }, - ], - "taskFailures": [], - "unformattedFiles": [], -} -`; diff --git a/linters/ansible-lint/test_data/ansible_lint_v6.22.1_non_FQCN.check.shot b/linters/ansible-lint/test_data/ansible_lint_v6.22.1_non_FQCN.check.shot deleted file mode 100644 index 19d429497..000000000 --- a/linters/ansible-lint/test_data/ansible_lint_v6.22.1_non_FQCN.check.shot +++ /dev/null @@ -1,43 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Testing linter ansible-lint test non_FQCN 1`] = ` -{ - "issues": [ - { - "code": "syntax-check[unknown-module]", - "column": "7", - "file": "jboss-standalone/demo-aws-launch.yml", - "issueClass": "ISSUE_CLASS_NEW", - "issueUrl": "https://ansible-lint.readthedocs.io/en/latest/default_rules.html#syntax-check[unknown-module]", - "level": "LEVEL_HIGH", - "line": "12", - "linter": "ansible-lint", - "message": "couldn't resolve module/action 'ec2'. This often indicates a misspelling, missing collection, or incorrect module path.", - "targetType": "custom", - }, - ], - "lintActions": [ - { - "command": "lint", - "fileGroupName": "custom", - "linter": "ansible-lint", - "paths": [ - "jboss-standalone", - ], - "verb": "TRUNK_VERB_CHECK", - }, - { - "command": "lint", - "fileGroupName": "custom", - "linter": "ansible-lint", - "paths": [ - "jboss-standalone", - ], - "upstream": true, - "verb": "TRUNK_VERB_CHECK", - }, - ], - "taskFailures": [], - "unformattedFiles": [], -} -`; diff --git a/linters/biome/biome.test.ts b/linters/biome/biome.test.ts index 76425a373..d0b29b37b 100644 --- a/linters/biome/biome.test.ts +++ b/linters/biome/biome.test.ts @@ -1,22 +1,5 @@ -import path from "path"; -import { customLinterCheckTest, linterCheckTest, linterFmtTest } from "tests"; -import { TrunkLintDriver } from "tests/driver"; -import { TEST_DATA } from "tests/utils"; +import { linterCheckTest, linterFmtTest } from "tests"; linterCheckTest({ linterName: "biome", namedTestPrefixes: ["basic_check"] }); linterFmtTest({ linterName: "biome", namedTestPrefixes: ["basic_fmt", "basic_json"] }); - -const preCheck = (driver: TrunkLintDriver) => { - // Write an invalid biome config and verify we surface an error for format. - // NOTE(Tyler): We should handle config errors better for 'lint' too, but the JSON - // output for biome is not stable and they don't support SARIF. - driver.writeFile("biome.json", JSON.stringify({ rules: { "no-foo": "error" } })); -}; - -customLinterCheckTest({ - linterName: "biome", - testName: "error", - args: path.join(TEST_DATA, "basic_check.in.ts"), - preCheck, -}); diff --git a/linters/biome/plugin.yaml b/linters/biome/plugin.yaml index a4b7a65a9..4176814b5 100644 --- a/linters/biome/plugin.yaml +++ b/linters/biome/plugin.yaml @@ -6,15 +6,18 @@ tools: runtime: node package: "@biomejs/biome" shims: [biome] - known_good_version: 1.4.1 + known_good_version: 1.9.4 lint: definitions: # Successor to the rome linter+formatter - name: biome files: - - typescript + - astro + - css + - graphql - javascript - json + - typescript description: A static analyzer for web projects commands: - name: lint @@ -29,8 +32,8 @@ lint: read_output_from: stderr - name: fmt output: rewrite - run: biome format --write "${target}" - success_codes: [0] + run: biome check --fix "${target}" + success_codes: [0, 1] batch: true cache_results: true formatter: true @@ -39,11 +42,12 @@ lint: suggest_if: config_present direct_configs: - biome.json + - biome.jsonc - rome.json # For backwards compatibility with rome affects_cache: - package.json - .editorconfig # Undocumented config file - known_good_version: 1.4.1 + known_good_version: 1.9.4 version_command: parse_regex: biome CLI version ${semver} run: biome --version diff --git a/linters/biome/test_data/biome_v1.4.1_basic_check.check.shot b/linters/biome/test_data/biome_v1.4.1_basic_check.check.shot deleted file mode 100644 index 2bde4ae46..000000000 --- a/linters/biome/test_data/biome_v1.4.1_basic_check.check.shot +++ /dev/null @@ -1,61 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Testing linter biome test basic_check 1`] = ` -{ - "issues": [ - { - "code": "lint/style/useEnumInitializers", - "column": "6", - "file": "test_data/basic_check.in.ts", - "issueClass": "ISSUE_CLASS_EXISTING", - "level": "LEVEL_HIGH", - "line": "4", - "linter": "biome", - "message": "This enum declaration contains members that are implicitly initialized.", - "targetType": "typescript", - }, - ], - "lintActions": [ - { - "command": "fmt", - "fileGroupName": "typescript", - "linter": "biome", - "paths": [ - "test_data/basic_check.in.ts", - ], - "verb": "TRUNK_VERB_FMT", - }, - { - "command": "lint", - "fileGroupName": "typescript", - "linter": "biome", - "paths": [ - "test_data/basic_check.in.ts", - ], - "verb": "TRUNK_VERB_CHECK", - }, - { - "command": "lint", - "fileGroupName": "typescript", - "linter": "biome", - "paths": [ - "test_data/basic_check.in.ts", - ], - "upstream": true, - "verb": "TRUNK_VERB_CHECK", - }, - ], - "taskFailures": [], - "unformattedFiles": [ - { - "column": "1", - "file": "test_data/basic_check.in.ts", - "issueClass": "ISSUE_CLASS_UNFORMATTED", - "level": "LEVEL_HIGH", - "line": "1", - "linter": "biome", - "message": "Incorrect formatting, autoformat by running 'trunk fmt'", - }, - ], -} -`; diff --git a/linters/biome/test_data/biome_v1.4.1_error.check.shot b/linters/biome/test_data/biome_v1.4.1_error.check.shot deleted file mode 100644 index c60995917..000000000 --- a/linters/biome/test_data/biome_v1.4.1_error.check.shot +++ /dev/null @@ -1,36 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Testing linter biome test error 1`] = ` -{ - "issues": [], - "lintActions": [ - { - "command": "lint", - "fileGroupName": "typescript", - "linter": "biome", - "paths": [ - "test_data/basic_check.in.ts", - ], - "verb": "TRUNK_VERB_CHECK", - }, - { - "command": "lint", - "fileGroupName": "typescript", - "linter": "biome", - "paths": [ - "test_data/basic_check.in.ts", - ], - "upstream": true, - "verb": "TRUNK_VERB_CHECK", - }, - ], - "taskFailures": [ - { - "details": StringMatching /\\.\\*\\$/m, - "message": "test_data/basic_check.in.ts", - "name": "biome", - }, - ], - "unformattedFiles": [], -} -`; diff --git a/linters/biome/test_data/biome_v1.6.0_basic_fmt.fmt.shot b/linters/biome/test_data/biome_v1.6.0_basic_fmt.fmt.shot deleted file mode 100644 index 0961c8a09..000000000 --- a/linters/biome/test_data/biome_v1.6.0_basic_fmt.fmt.shot +++ /dev/null @@ -1,23 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Testing formatter biome test basic_fmt 1`] = ` -"const foobar = () => {}; -const barfoo = () => {}; - -enum Bar { - Baz, -} - -const foo = (bar: Bar) => { - switch (bar) { - case Bar.Baz: - foobar(); - barfoo(); - break; - } - { - !foo ? null : 1; - } -}; -" -`; diff --git a/linters/biome/test_data/biome_v1.6.0_basic_json.fmt.shot b/linters/biome/test_data/biome_v1.6.0_basic_json.fmt.shot deleted file mode 100644 index 3b5af7e15..000000000 --- a/linters/biome/test_data/biome_v1.6.0_basic_json.fmt.shot +++ /dev/null @@ -1,6 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Testing formatter biome test basic_json 1`] = ` -"{ "a": "foo", "b": 1, "a": true } -" -`; diff --git a/linters/biome/test_data/biome_v1.6.0_basic_check.check.shot b/linters/biome/test_data/biome_v1.9.4_basic_check.check.shot similarity index 100% rename from linters/biome/test_data/biome_v1.6.0_basic_check.check.shot rename to linters/biome/test_data/biome_v1.9.4_basic_check.check.shot diff --git a/linters/biome/test_data/biome_v1.4.1_basic_fmt.fmt.shot b/linters/biome/test_data/biome_v1.9.4_basic_fmt.fmt.shot similarity index 89% rename from linters/biome/test_data/biome_v1.4.1_basic_fmt.fmt.shot rename to linters/biome/test_data/biome_v1.9.4_basic_fmt.fmt.shot index 0961c8a09..1e2f30ad4 100644 --- a/linters/biome/test_data/biome_v1.4.1_basic_fmt.fmt.shot +++ b/linters/biome/test_data/biome_v1.9.4_basic_fmt.fmt.shot @@ -5,7 +5,7 @@ exports[`Testing formatter biome test basic_fmt 1`] = ` const barfoo = () => {}; enum Bar { - Baz, + Baz = 0, } const foo = (bar: Bar) => { @@ -15,9 +15,7 @@ const foo = (bar: Bar) => { barfoo(); break; } - { - !foo ? null : 1; - } + !foo ? null : 1; }; " `; diff --git a/linters/biome/test_data/biome_v1.4.1_basic_json.fmt.shot b/linters/biome/test_data/biome_v1.9.4_basic_json.fmt.shot similarity index 100% rename from linters/biome/test_data/biome_v1.4.1_basic_json.fmt.shot rename to linters/biome/test_data/biome_v1.9.4_basic_json.fmt.shot diff --git a/linters/biome/test_data/biome_v1.6.0_error.check.shot b/linters/biome/test_data/biome_v1.9.4_error.check.shot similarity index 74% rename from linters/biome/test_data/biome_v1.6.0_error.check.shot rename to linters/biome/test_data/biome_v1.9.4_error.check.shot index c60995917..e959c7ff4 100644 --- a/linters/biome/test_data/biome_v1.6.0_error.check.shot +++ b/linters/biome/test_data/biome_v1.9.4_error.check.shot @@ -4,6 +4,15 @@ exports[`Testing linter biome test error 1`] = ` { "issues": [], "lintActions": [ + { + "command": "fmt", + "fileGroupName": "typescript", + "linter": "biome", + "paths": [ + "test_data/basic_check.in.ts", + ], + "verb": "TRUNK_VERB_FMT", + }, { "command": "lint", "fileGroupName": "typescript", @@ -24,13 +33,7 @@ exports[`Testing linter biome test error 1`] = ` "verb": "TRUNK_VERB_CHECK", }, ], - "taskFailures": [ - { - "details": StringMatching /\\.\\*\\$/m, - "message": "test_data/basic_check.in.ts", - "name": "biome", - }, - ], + "taskFailures": [], "unformattedFiles": [], } `; diff --git a/linters/gitleaks/test_data/gitleaks_v8.22.0_basic.check.shot b/linters/gitleaks/test_data/gitleaks_v8.22.0_basic.check.shot new file mode 100644 index 000000000..d9bc1f9cb --- /dev/null +++ b/linters/gitleaks/test_data/gitleaks_v8.22.0_basic.check.shot @@ -0,0 +1,68 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter gitleaks test basic 1`] = ` +{ + "issues": [ + { + "code": "aws-access-token", + "column": "15", + "file": "test_data/basic.py", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "3", + "linter": "gitleaks", + "message": "aws-access-token has detected secret for file test_data/basic.py.", + "ranges": [ + { + "filePath": "test_data/basic.py", + "length": "19", + "offset": "58", + }, + ], + "targetType": "ALL", + }, + { + "code": "private-key", + "column": "19", + "file": "test_data/basic.py", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "5", + "linter": "gitleaks", + "message": "private-key has detected secret for file test_data/basic.py.", + "ranges": [ + { + "filePath": "test_data/basic.py", + "length": "397", + "offset": "98", + }, + ], + "targetType": "ALL", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "gitleaks", + "paths": [ + "test_data/basic.py", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "gitleaks", + "paths": [ + "test_data/basic.py", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/golangci-lint/test_data/golangci_lint_v1.63.4_all.check.shot b/linters/golangci-lint/test_data/golangci_lint_v1.63.4_all.check.shot new file mode 100644 index 000000000..4cfb4238c --- /dev/null +++ b/linters/golangci-lint/test_data/golangci_lint_v1.63.4_all.check.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter golangci-lint test all 1`] = ` +{ + "issues": [ + { + "code": "godot", + "column": "1", + "file": "test_data/basic.go", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://golangci-lint.run/usage/linters/", + "level": "LEVEL_HIGH", + "line": "5", + "linter": "golangci-lint", + "message": "Comment should end in a period", + "targetType": "go", + }, + { + "code": "errcheck", + "column": "12", + "file": "test_data/basic.go", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://golangci-lint.run/usage/linters/", + "level": "LEVEL_HIGH", + "line": "8", + "linter": "golangci-lint", + "message": "Error return value of \`time.Parse\` is not checked", + "targetType": "go", + }, + { + "code": "unused", + "column": "6", + "file": "test_data/unused_func.go", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://golangci-lint.run/usage/linters/", + "level": "LEVEL_HIGH", + "line": "5", + "linter": "golangci-lint", + "message": "func \`helper\` is unused", + "targetType": "go", + }, + { + "code": "typecheck", + "file": "test_data/wrapper/printer.go", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://golangci-lint.run/usage/linters/", + "level": "LEVEL_HIGH", + "line": "1", + "linter": "golangci-lint", + "message": ": # golangcilint_linter_test/wrapper +wrapper/printer.go:12:23: undefined: Wrapper2", + "targetType": "go", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "go", + "linter": "golangci-lint", + "paths": [ + "test_data", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "go", + "linter": "golangci-lint", + "paths": [ + "test_data/wrapper", + ], + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/golangci-lint/test_data/golangci_lint_v1.63.4_empty.check.shot b/linters/golangci-lint/test_data/golangci_lint_v1.63.4_empty.check.shot new file mode 100644 index 000000000..08f295adc --- /dev/null +++ b/linters/golangci-lint/test_data/golangci_lint_v1.63.4_empty.check.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter golangci-lint test empty 1`] = ` +{ + "issues": [ + { + "code": "typecheck", + "column": "1", + "file": "test_data/empty.go", + "issueClass": "ISSUE_CLASS_NEW", + "issueUrl": "https://golangci-lint.run/usage/linters/", + "level": "LEVEL_HIGH", + "line": "1", + "linter": "golangci-lint", + "message": "expected 'package', found 'EOF'", + "targetType": "go", + }, + { + "code": "typecheck", + "file": "test_data/wrapper/printer.go", + "issueClass": "ISSUE_CLASS_EXISTING", + "issueUrl": "https://golangci-lint.run/usage/linters/", + "level": "LEVEL_HIGH", + "line": "1", + "linter": "golangci-lint", + "message": ": # golangcilint_linter_test/wrapper +wrapper/printer.go:12:23: undefined: Wrapper2", + "targetType": "go", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "go", + "linter": "golangci-lint", + "paths": [ + "test_data", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "go", + "linter": "golangci-lint", + "paths": [ + "test_data/wrapper", + ], + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/golangci-lint/test_data/golangci_lint_v1.63.4_unbuildable.check.shot b/linters/golangci-lint/test_data/golangci_lint_v1.63.4_unbuildable.check.shot new file mode 100644 index 000000000..5e14a0891 --- /dev/null +++ b/linters/golangci-lint/test_data/golangci_lint_v1.63.4_unbuildable.check.shot @@ -0,0 +1,31 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter golangci-lint test unbuildable 1`] = ` +{ + "issues": [ + { + "code": "error", + "file": ".", + "issueClass": "ISSUE_CLASS_NEW", + "level": "LEVEL_HIGH", + "linter": "golangci-lint", + "message": "typechecking error: build constraints exclude all Go files in /tmp/plugins_", + "targetType": "go", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "go", + "linter": "golangci-lint", + "paths": [ + ".", + ], + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/hadolint/test_data/hadolint_v2.10.0_CUSTOM.check.shot b/linters/hadolint/test_data/hadolint_v2.10.0_CUSTOM.check.shot index e5b0d64c0..4fe2209ca 100644 --- a/linters/hadolint/test_data/hadolint_v2.10.0_CUSTOM.check.shot +++ b/linters/hadolint/test_data/hadolint_v2.10.0_CUSTOM.check.shot @@ -26,15 +26,6 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` ], "verb": "TRUNK_VERB_CHECK", }, - { - "command": "lint", - "fileGroupName": "docker", - "linter": "hadolint", - "paths": [ - "test_data/Dockerfile.empty", - ], - "verb": "TRUNK_VERB_CHECK", - }, { "command": "lint", "fileGroupName": "docker", @@ -53,15 +44,6 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` ], "verb": "TRUNK_VERB_CHECK", }, - { - "command": "lint", - "fileGroupName": "docker", - "linter": "hadolint", - "paths": [ - "test_data/nested/Dockerfile.debug", - ], - "verb": "TRUNK_VERB_CHECK", - }, { "command": "lint", "fileGroupName": "docker", @@ -90,16 +72,6 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` "upstream": true, "verb": "TRUNK_VERB_CHECK", }, - { - "command": "lint", - "fileGroupName": "docker", - "linter": "hadolint", - "paths": [ - "test_data/Dockerfile.empty", - ], - "upstream": true, - "verb": "TRUNK_VERB_CHECK", - }, { "command": "lint", "fileGroupName": "docker", @@ -120,16 +92,6 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` "upstream": true, "verb": "TRUNK_VERB_CHECK", }, - { - "command": "lint", - "fileGroupName": "docker", - "linter": "hadolint", - "paths": [ - "test_data/nested/Dockerfile.debug", - ], - "upstream": true, - "verb": "TRUNK_VERB_CHECK", - }, { "command": "lint", "fileGroupName": "docker", diff --git a/linters/hadolint/test_data/hadolint_v2.12.1-beta_CUSTOM.check.shot b/linters/hadolint/test_data/hadolint_v2.12.1-beta_CUSTOM.check.shot index e5b0d64c0..4fe2209ca 100644 --- a/linters/hadolint/test_data/hadolint_v2.12.1-beta_CUSTOM.check.shot +++ b/linters/hadolint/test_data/hadolint_v2.12.1-beta_CUSTOM.check.shot @@ -26,15 +26,6 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` ], "verb": "TRUNK_VERB_CHECK", }, - { - "command": "lint", - "fileGroupName": "docker", - "linter": "hadolint", - "paths": [ - "test_data/Dockerfile.empty", - ], - "verb": "TRUNK_VERB_CHECK", - }, { "command": "lint", "fileGroupName": "docker", @@ -53,15 +44,6 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` ], "verb": "TRUNK_VERB_CHECK", }, - { - "command": "lint", - "fileGroupName": "docker", - "linter": "hadolint", - "paths": [ - "test_data/nested/Dockerfile.debug", - ], - "verb": "TRUNK_VERB_CHECK", - }, { "command": "lint", "fileGroupName": "docker", @@ -90,16 +72,6 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` "upstream": true, "verb": "TRUNK_VERB_CHECK", }, - { - "command": "lint", - "fileGroupName": "docker", - "linter": "hadolint", - "paths": [ - "test_data/Dockerfile.empty", - ], - "upstream": true, - "verb": "TRUNK_VERB_CHECK", - }, { "command": "lint", "fileGroupName": "docker", @@ -120,16 +92,6 @@ exports[`Testing linter hadolint test CUSTOM 1`] = ` "upstream": true, "verb": "TRUNK_VERB_CHECK", }, - { - "command": "lint", - "fileGroupName": "docker", - "linter": "hadolint", - "paths": [ - "test_data/nested/Dockerfile.debug", - ], - "upstream": true, - "verb": "TRUNK_VERB_CHECK", - }, { "command": "lint", "fileGroupName": "docker", diff --git a/linters/opa/test_data/opa_v1.0.0_basic.fmt.shot b/linters/opa/test_data/opa_v1.0.0_basic.fmt.shot new file mode 100644 index 000000000..f63e8ba9e --- /dev/null +++ b/linters/opa/test_data/opa_v1.0.0_basic.fmt.shot @@ -0,0 +1,18 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing formatter opa test basic 1`] = ` +"package authz + +import rego.v1 + +default allow := false + +allow if { + isEmployee + "developer" in input.user.roles +} + +isEmployee if regex.match("@acmecorp\\\\.com$", input.user.email) +" +`; diff --git a/linters/plugin.yaml b/linters/plugin.yaml index 3150762b0..c57210920 100644 --- a/linters/plugin.yaml +++ b/linters/plugin.yaml @@ -61,6 +61,13 @@ lint: - slashes-block - slashes-inline + - name: astro + extensions: + - astro + comments: + - html-tag + - brace-slashes-block + - name: bazel-build extensions: - BUILD @@ -170,6 +177,18 @@ lint: - slashes-block - name: cuda + inherit: + - cuda-header + - cuda-source + + - name: cuda-header + extensions: + - cuh + comments: + - slashes-block + - slashes-inline + + - name: cuda-source extensions: - cu comments: @@ -202,7 +221,8 @@ lint: # ?: is a non-capturing group, so that the RE2 DFA is more memory efficient # NOTE(Tyler): This is more strict than it realistically needs to be, but this partial match # and the file extensions provide a general enough capture. - - (?i)(?:^|/)Dockerfile\..+$ + # Note that re2 does not support ?!, so this does not capture all correct cases. + - (?i)(?:^|/)Dockerfile\.(?!.*\.dockerignore$).+$ filenames: - dockerfile - Dockerfile @@ -592,7 +612,6 @@ lint: - name: terraform extensions: - tf - - tf.json comments: - hash - slashes-inline diff --git a/linters/ruff/test_data/ruff_nbqa_v0.9.2_basic_nb.check.shot b/linters/ruff/test_data/ruff_nbqa_v0.9.2_basic_nb.check.shot new file mode 100644 index 000000000..339a109c5 --- /dev/null +++ b/linters/ruff/test_data/ruff_nbqa_v0.9.2_basic_nb.check.shot @@ -0,0 +1,49 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter ruff-nbqa test basic_nb 1`] = ` +{ + "issues": [ + { + "code": "error", + "file": "test_data/basic_nb.in.ipynb", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "linter": "ruff-nbqa", + "message": "/tmp/plugins_/test_data/basic_nb.in.ipynb:cell_1:1:8: F401 [*] \`os\` imported but unused + | +1 | # %%NBQA-CELL-SEP +2 | import os + | ^^ F401 +3 | +4 | print("Hello World!") + | + = help: Remove unused import: \`os\`", + "targetType": "jupyter", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "jupyter", + "linter": "ruff-nbqa", + "paths": [ + "test_data/basic_nb.in.ipynb", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "jupyter", + "linter": "ruff-nbqa", + "paths": [ + "test_data/basic_nb.in.ipynb", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/snyk/plugin.yaml b/linters/snyk/plugin.yaml new file mode 100644 index 000000000..4849c5c64 --- /dev/null +++ b/linters/snyk/plugin.yaml @@ -0,0 +1,66 @@ +version: 0.1 +downloads: + - name: snyk + downloads: + - url: https://downloads.snyk.io/cli/v${version}/snyk-${os}-arm64 + cpu: arm_64 + os: + macos: macos + linux: linux + - url: https://downloads.snyk.io/cli/v${version}/snyk-${os} + cpu: x86_64 + os: + macos: macos + linux: linux + - url: https://downloads.snyk.io/cli/v${version}/snyk-win.exe + os: windows +tools: + definitions: + - name: snyk + download: snyk + known_good_version: 1.1295.0 + shims: [snyk] + health_checks: + - command: snyk --version + parse_regex: ${semver} +lint: + definitions: + - name: snyk + tools: [snyk] + suggest_if: config_present + description: Security scanning tool for code, dependencies and containers + known_good_version: 1.1295.0 + commands: + - name: test + files: [lockfile] + output: sarif + run: snyk test --sarif --skip-unresolved --file=${target} + success_codes: [0, 1] # Snyk returns 1 when vulnerabilities are found + read_output_from: stdout + batch: false + is_security: true + - name: code + files: [javascript, typescript, java, python] + output: sarif + run: snyk code test --sarif . + run_from: ${parent} + success_codes: [0, 1] + read_output_from: stdout + sandbox_type: copy_targets + batch: true + is_security: true + - name: container + files: [docker] + output: sarif + run: snyk container test --sarif ${target} + success_codes: [0, 1] + read_output_from: stdout + batch: true + is_security: true + direct_configs: [.snyk] + environment: + - name: SNYK_TOKEN + optional: true + value: ${env.SNYK_TOKEN} + - name: PATH + list: ["${linter}", "${env.PATH}"] diff --git a/linters/snyk/snyk.test.ts b/linters/snyk/snyk.test.ts new file mode 100644 index 000000000..c382ce7ca --- /dev/null +++ b/linters/snyk/snyk.test.ts @@ -0,0 +1,5 @@ +import { customLinterCheckTest } from "tests"; +import { TEST_DATA } from "tests/utils"; + +// Requires SNYK_TOKEN to run +customLinterCheckTest({ linterName: "snyk", args: TEST_DATA, testName: "basic" }); diff --git a/linters/snyk/test_data/SqlInjectionLess4.java b/linters/snyk/test_data/SqlInjectionLess4.java new file mode 100644 index 000000000..dafab92fd --- /dev/null +++ b/linters/snyk/test_data/SqlInjectionLess4.java @@ -0,0 +1,77 @@ + +/* + * This file is part of WebGoat, an Open Web Application Security Project utility. For details, please see http://www.owasp.org/ + * + * Copyright (c) 2002 - 2019 Bruce Mayhew + * + * This program is free software; you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with this program; if + * not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * Getting Source ============== + * + * Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software projects. + */ + + package org.owasp.webgoat.sql_injection.introduction; + + import org.owasp.webgoat.assignments.AssignmentEndpoint; + import org.owasp.webgoat.assignments.AssignmentHints; + import org.owasp.webgoat.assignments.AttackResult; + import org.springframework.web.bind.annotation.PostMapping; + import org.springframework.web.bind.annotation.RequestParam; + import org.springframework.web.bind.annotation.ResponseBody; + import org.springframework.web.bind.annotation.RestController; + + import javax.sql.DataSource; + import java.sql.*; + + import static java.sql.ResultSet.*; + + + @RestController + @AssignmentHints(value = {"SqlStringInjectionHint4-1", "SqlStringInjectionHint4-2", "SqlStringInjectionHint4-3"}) + public class SqlInjectionLesson4 extends AssignmentEndpoint { + + private final DataSource dataSource; + + public SqlInjectionLesson4(DataSource dataSource) { + this.dataSource = dataSource; + } + + @PostMapping("/SqlInjection/attack4") + @ResponseBody + public AttackResult completed(@RequestParam String query) { + return injectableQuery(query); + } + + protected AttackResult injectableQuery(String query) { + try (Connection connection = dataSource.getConnection()) { + try (Statement statement = connection.createStatement(TYPE_SCROLL_INSENSITIVE, CONCUR_READ_ONLY)) { + statement.executeUpdate(query); + connection.commit(); + ResultSet results = statement.executeQuery("SELECT phone from employees;"); + StringBuffer output = new StringBuffer(); + // user completes lesson if column phone exists + if (results.first()) { + output.append(""); + return success(this).output(output.toString()).build(); + } else { + return failed(this).output(output.toString()).build(); + } + } catch (SQLException sqle) { + return failed(this).output(sqle.getMessage()).build(); + } + } catch (Exception e) { + return failed(this).output(this.getClass().getName() + " : " + e.getMessage()).build(); + } + } + } diff --git a/linters/snyk/test_data/index.js b/linters/snyk/test_data/index.js new file mode 100644 index 000000000..e01b12544 --- /dev/null +++ b/linters/snyk/test_data/index.js @@ -0,0 +1,291 @@ +var utils = require('../utils'); +var mongoose = require('mongoose'); +var Todo = mongoose.model('Todo'); +var User = mongoose.model('User'); +// TODO: +var hms = require('humanize-ms'); +var ms = require('ms'); +var streamBuffers = require('stream-buffers'); +var readline = require('readline'); +var moment = require('moment'); +var exec = require('child_process').exec; + +// zip-slip +var fileType = require('file-type'); +var AdmZip = require('adm-zip'); +var fs = require('fs'); + +// prototype-pollution +var _ = require('lodash'); + +exports.index = function (req, res, next) { + Todo. + find({}). + sort('-updated_at'). + exec(function (err, todos) { + if (err) return next(err); + + res.render('index', { + title: 'Goof TODO', + subhead: 'Vulnerabilities at their best', + todos: todos, + }); + }); +}; + + +exports.admin = function (req, res, next) { + console.log(req.body); + User.find({ username: req.body.username, password: req.body.password }, function (err, users) { + if (users.length > 0) { + return res.render('admin', { + title: 'Admin Access Granted', + granted: true, + }); + } else { + return res.render('admin', { + title: 'Admin Access', + granted: false, + }); + } + }); + +}; + +function parse(todo) { + var t = todo; + + var remindToken = ' in '; + var reminder = t.toString().indexOf(remindToken); + if (reminder > 0) { + var time = t.slice(reminder + remindToken.length); + time = time.replace(/\n$/, ''); + + var period = hms(time); + + console.log('period: ' + period); + + // remove it + t = t.slice(0, reminder); + if (typeof period != 'undefined') { + t += ' [' + ms(period) + ']'; + } + } + return t; +} + +exports.create = function (req, res, next) { + // console.log('req.body: ' + JSON.stringify(req.body)); + + var item = req.body.content; + var imgRegex = /\!\[alt text\]\((http.*)\s\".*/; + if (typeof(item) == 'string' && item.match(imgRegex)) { + var url = item.match(imgRegex)[1]; + console.log('found img: ' + url); + + exec('identify ' + url, function (err, stdout, stderr) { + console.log(err); + if (err !== null) { + console.log('Error (' + err + '):' + stderr); + } + }); + + } else { + item = parse(item); + } + + new Todo({ + content: item, + updated_at: Date.now(), + }).save(function (err, todo, count) { + if (err) return next(err); + + /* + res.setHeader('Data', todo.content.toString('base64')); + res.redirect('/'); + */ + + res.setHeader('Location', '/'); + res.status(302).send(todo.content.toString('base64')); + + // res.redirect('/#' + todo.content.toString('base64')); + }); +}; + +exports.destroy = function (req, res, next) { + Todo.findById(req.params.id, function (err, todo) { + + try { + todo.remove(function (err, todo) { + if (err) return next(err); + res.redirect('/'); + }); + } catch(e) { + } + }); +}; + +exports.edit = function(req, res, next) { + Todo. + find({}). + sort('-updated_at'). + exec(function (err, todos) { + if (err) return next(err); + + res.render('edit', { + title : 'TODO', + todos : todos, + current : req.params.id + }); + }); +}; + +exports.update = function(req, res, next) { + Todo.findById(req.params.id, function (err, todo) { + + todo.content = req.body.content; + todo.updated_at = Date.now(); + todo.save(function (err, todo, count) { + if(err) return next(err); + + res.redirect('/'); + }); + }); +}; + +// ** express turns the cookie key to lowercase ** +exports.current_user = function (req, res, next) { + + next(); +}; + +function isBlank(str) { + return (!str || /^\s*$/.test(str)); +} + +exports.import = function (req, res, next) { + if (!req.files) { + res.send('No files were uploaded.'); + return; + } + + var importFile = req.files.importFile; + var data; + var importedFileType = fileType(importFile.data); + var zipFileExt = { ext: "zip", mime: "application/zip" }; + if (importedFileType === null) { + importedFileType = { ext: "txt", mime: "text/plain" }; + } + if (importedFileType["mime"] === zipFileExt["mime"]) { + var zip = AdmZip(importFile.data); + var extracted_path = "/tmp/extracted_files"; + zip.extractAllTo(extracted_path, true); + data = "No backup.txt file found"; + fs.readFile('backup.txt', 'ascii', function(err, data) { + if (!err) { + data = data; + }}); + } else { + data = importFile.data.toString('ascii'); + } + var lines = data.split('\n'); + lines.forEach(function (line) { + var parts = line.split(','); + var what = parts[0]; + console.log('importing ' + what); + var when = parts[1]; + var locale = parts[2]; + var format = parts[3]; + var item = what; + if (!isBlank(what)) { + if (!isBlank(when) && !isBlank(locale) && !isBlank(format)) { + console.log('setting locale ' + parts[1]); + moment.locale(locale); + var d = moment(when); + console.log('formatting ' + d); + item += ' [' + d.format(format) + ']'; + } + + new Todo({ + content: item, + updated_at: Date.now(), + }).save(function (err, todo, count) { + if (err) return next(err); + console.log('added ' + todo); + }); + } + }); + + res.redirect('/'); +}; + +exports.about_new = function (req, res, next) { + console.log(JSON.stringify(req.query)); + return res.render("about_new.dust", + { + title: 'Goof TODO', + subhead: 'Vulnerabilities at their best', + device: req.query.device + }); +}; + +// Prototype Pollution + +/////////////////////////////////////////////////////////////////////////////// +// In order of simplicity we are not using any database. But you can write the +// same logic using MongoDB. +const users = [ + // You know password for the user. + {name: 'user', password: 'pwd'}, + // You don't know password for the admin. + {name: 'admin', password: Math.random().toString(32), canDelete: true}, +]; + +let messages = []; +let lastId = 1; + +function findUser(auth) { + return users.find((u) => + u.name === auth.name && + u.password === auth.password); +} +/////////////////////////////////////////////////////////////////////////////// + +exports.chat = { + get(req, res) { + res.send(messages); + }, + add(req, res) { + const user = findUser(req.body.auth || {}); + + if (!user) { + res.status(403).send({ok: false, error: 'Access denied'}); + return; + } + + const message = { + // Default message icon. Cen be overwritten by user. + icon: '👋', + }; + + _.merge(message, req.body.message, { + id: lastId++, + timestamp: Date.now(), + userName: user.name, + }); + + messages.push(message); + res.send({ok: true}); + }, + delete(req, res) { + const user = findUser(req.body.auth || {}); + + if (!user || !user.canDelete) { + res.status(403).send({ok: false, error: 'Access denied'}); + return; + } + + messages = messages.filter((m) => m.id !== req.body.messageId); + res.send({ok: true}); + } +}; diff --git a/linters/snyk/test_data/snyk_v1.1295.0_basic.check.shot b/linters/snyk/test_data/snyk_v1.1295.0_basic.check.shot new file mode 100644 index 000000000..a535e0542 --- /dev/null +++ b/linters/snyk/test_data/snyk_v1.1295.0_basic.check.shot @@ -0,0 +1,145 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Testing linter snyk test basic 1`] = ` +{ + "issues": [ + { + "code": "java/Sqli", + "column": "18", + "file": "test_data/SqlInjectionLess4.java", + "isSecurity": true, + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "59", + "linter": "snyk", + "message": "Unsanitized input from an HTTP parameter flows into executeUpdate, where it is used in an SQL query. This may result in an SQL Injection vulnerability.", + "ranges": [ + { + "filePath": "test_data/SqlInjectionLess4.java", + "length": "23", + "offset": "2394", + }, + ], + "targetType": "javascript", + }, + { + "code": "javascript/NoRateLimitingForExpensiveWebOperation", + "column": "18", + "file": "test_data/index.js", + "isSecurity": true, + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_MEDIUM", + "line": "166", + "linter": "snyk", + "message": "This endpoint handler performs a file system operation and does not use a rate-limiting mechanism. It may enable the attackers to perform Denial-of-service attacks. Consider using a rate-limiting middleware such as express-limit.", + "ranges": [ + { + "filePath": "test_data/index.js", + "length": "1567", + "offset": "3702", + }, + ], + "targetType": "javascript", + }, + { + "code": "javascript/NoRateLimitingForExpensiveWebOperation", + "column": "21", + "file": "test_data/index.js", + "isSecurity": true, + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_MEDIUM", + "line": "222", + "linter": "snyk", + "message": "This endpoint handler performs a file system operation and does not use a rate-limiting mechanism. It may enable the attackers to perform Denial-of-service attacks. Consider using a rate-limiting middleware such as express-limit.", + "ranges": [ + { + "filePath": "test_data/index.js", + "length": "242", + "offset": "5292", + }, + ], + "targetType": "javascript", + }, + { + "code": "javascript/NoSqli", + "column": "8", + "file": "test_data/index.js", + "isSecurity": true, + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "39", + "linter": "snyk", + "message": "Unsanitized input from the HTTP request body flows into find, where it is used in an NoSQL query. This may result in an NoSQL Injection vulnerability.", + "ranges": [ + { + "filePath": "test_data/index.js", + "length": "4", + "offset": "918", + }, + ], + "targetType": "javascript", + }, + { + "code": "javascript/NoRateLimitingForExpensiveWebOperation", + "column": "18", + "file": "test_data/index.js", + "isSecurity": true, + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_MEDIUM", + "line": "77", + "linter": "snyk", + "message": "This endpoint handler performs a system command execution and does not use a rate-limiting mechanism. It may enable the attackers to perform Denial-of-service attacks. Consider using a rate-limiting middleware such as express-limit.", + "ranges": [ + { + "filePath": "test_data/index.js", + "length": "928", + "offset": "1741", + }, + ], + "targetType": "javascript", + }, + ], + "lintActions": [ + { + "command": "code", + "fileGroupName": "java", + "linter": "snyk", + "paths": [ + "test_data/SqlInjectionLess4.java", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "code", + "fileGroupName": "javascript", + "linter": "snyk", + "paths": [ + "test_data/index.js", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "code", + "fileGroupName": "java", + "linter": "snyk", + "paths": [ + "test_data/SqlInjectionLess4.java", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "code", + "fileGroupName": "javascript", + "linter": "snyk", + "paths": [ + "test_data/index.js", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/squawk/test_data/squawk_v1.5.3_basic.check.shot b/linters/squawk/test_data/squawk_v1.5.3_basic.check.shot new file mode 100644 index 000000000..11479bba6 --- /dev/null +++ b/linters/squawk/test_data/squawk_v1.5.3_basic.check.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter squawk test basic 1`] = ` +{ + "issues": [ + { + "code": "prefer-robust-stmts", + "file": "test_data/basic.in.sql", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "1", + "linter": "squawk", + "message": "Consider wrapping in a transaction or adding a IF NOT EXISTS clause if the statement supports it.", + "targetType": "sql", + }, + { + "code": "prefer-big-int", + "file": "test_data/basic.in.sql", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "2", + "linter": "squawk", + "message": "Hitting the max 32 bit integer is possible and may break your application. Use 64bit integer values instead to prevent hitting this limit.", + "targetType": "sql", + }, + { + "code": "prefer-bigint-over-int", + "file": "test_data/basic.in.sql", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "2", + "linter": "squawk", + "message": "Hitting the max 32 bit integer is possible and may break your application. Use 64bit integer values instead to prevent hitting this limit.", + "targetType": "sql", + }, + { + "code": "prefer-identity", + "file": "test_data/basic.in.sql", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "2", + "linter": "squawk", + "message": "Serial types have confusing behaviors that make schema management difficult. Use identity columns instead for more features and better usability.", + "targetType": "sql", + }, + { + "code": "prefer-text-field", + "file": "test_data/basic.in.sql", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "3", + "linter": "squawk", + "message": "Changing the size of a varchar field requires an ACCESS EXCLUSIVE lock. Use a text field with a check constraint.", + "targetType": "sql", + }, + { + "code": "prefer-robust-stmts", + "column": "2", + "file": "test_data/basic.in.sql", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "5", + "linter": "squawk", + "message": "Consider wrapping in a transaction or adding a IF NOT EXISTS clause if the statement supports it.", + "targetType": "sql", + }, + { + "code": "require-concurrent-index-creation", + "column": "2", + "file": "test_data/basic.in.sql", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "5", + "linter": "squawk", + "message": "Creating an index blocks writes. Create the index CONCURRENTLY.", + "targetType": "sql", + }, + { + "code": "disallowed-unique-constraint", + "column": "2", + "file": "test_data/basic.in.sql", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "7", + "linter": "squawk", + "message": "Adding a UNIQUE constraint requires an ACCESS EXCLUSIVE lock which blocks reads. Create an index CONCURRENTLY and create the constraint using the index.", + "targetType": "sql", + }, + { + "code": "prefer-robust-stmts", + "column": "2", + "file": "test_data/basic.in.sql", + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "7", + "linter": "squawk", + "message": "Consider wrapping in a transaction or adding a IF NOT EXISTS clause if the statement supports it.", + "targetType": "sql", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "sql", + "linter": "squawk", + "paths": [ + "test_data/basic.in.sql", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "sql", + "linter": "squawk", + "paths": [ + "test_data/basic.in.sql", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/svgo/svgo.config.js b/linters/svgo/svgo.config.mjs similarity index 93% rename from linters/svgo/svgo.config.js rename to linters/svgo/svgo.config.mjs index b257d1349..55b4a7a11 100644 --- a/linters/svgo/svgo.config.js +++ b/linters/svgo/svgo.config.mjs @@ -1,4 +1,4 @@ -module.exports = { +export default { plugins: [ { name: "preset-default", diff --git a/linters/trufflehog/test_data/trufflehog_git_v3.88.3_CUSTOM.check.shot b/linters/trufflehog/test_data/trufflehog_git_v3.88.3_CUSTOM.check.shot new file mode 100644 index 000000000..e09657b97 --- /dev/null +++ b/linters/trufflehog/test_data/trufflehog_git_v3.88.3_CUSTOM.check.shot @@ -0,0 +1,43 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter trufflehog-git test CUSTOM 1`] = ` +{ + "issues": [ + { + "code": "URI", + "file": ".", + "isSecurity": true, + "issueClass": "ISSUE_CLASS_NEW", + "level": "LEVEL_HIGH", + "linter": "trufflehog-git", + "message": "secrets.in.py:8: Secret detected: https://admin:********@the-internet.herokuapp.com/basic_auth on commit (file since deleted)", + "targetType": "ALL", + }, + { + "code": "URI", + "file": "secrets2.in.py", + "isSecurity": true, + "issueClass": "ISSUE_CLASS_NEW", + "level": "LEVEL_HIGH", + "line": "8", + "linter": "trufflehog-git", + "message": "Secret detected: https://admin:********@the-internet.herokuapp.com/basic_auth on commit ", + "targetType": "ALL", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trufflehog-git", + "paths": [ + ".", + ], + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/trufflehog/test_data/trufflehog_v3.88.3_buff_size.check.shot b/linters/trufflehog/test_data/trufflehog_v3.88.3_buff_size.check.shot new file mode 100644 index 000000000..da6cc9615 --- /dev/null +++ b/linters/trufflehog/test_data/trufflehog_v3.88.3_buff_size.check.shot @@ -0,0 +1,31 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter trufflehog test buff_size 1`] = ` +{ + "issues": [], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trufflehog", + "paths": [ + "test_data/buff_size.in.cc", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trufflehog", + "paths": [ + "test_data/buff_size.in.cc", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/trufflehog/test_data/trufflehog_v3.88.3_secrets.check.shot b/linters/trufflehog/test_data/trufflehog_v3.88.3_secrets.check.shot new file mode 100644 index 000000000..48b3993e9 --- /dev/null +++ b/linters/trufflehog/test_data/trufflehog_v3.88.3_secrets.check.shot @@ -0,0 +1,43 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter trufflehog test secrets 1`] = ` +{ + "issues": [ + { + "code": "URI", + "file": "test_data/secrets.in.py", + "isSecurity": true, + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "8", + "linter": "trufflehog", + "message": "Secret detected: https://admin:********@the-internet.herokuapp.com/basic_auth", + "targetType": "ALL", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trufflehog", + "paths": [ + "test_data/secrets.in.py", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trufflehog", + "paths": [ + "test_data/secrets.in.py", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/linters/trufflehog/test_data/trufflehog_v3.88.3_wrong_line_number.check.shot b/linters/trufflehog/test_data/trufflehog_v3.88.3_wrong_line_number.check.shot new file mode 100644 index 000000000..265e27257 --- /dev/null +++ b/linters/trufflehog/test_data/trufflehog_v3.88.3_wrong_line_number.check.shot @@ -0,0 +1,54 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP +// trunk-upgrade-validation:RELEASE + +exports[`Testing linter trufflehog test wrong_line_number 1`] = ` +{ + "issues": [ + { + "code": "URI", + "file": "test_data/wrong_line_number.in.ts", + "isSecurity": true, + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "587", + "linter": "trufflehog", + "message": "Secret detected: https://admin:********@the-internet.herokuapp.com/basic_auth", + "targetType": "ALL", + }, + { + "code": "URI", + "file": "test_data/wrong_line_number.in.ts", + "isSecurity": true, + "issueClass": "ISSUE_CLASS_EXISTING", + "level": "LEVEL_HIGH", + "line": "592", + "linter": "trufflehog", + "message": "Secret detected: https://admin:********@the-internet.herokuapp.com/basic_auth", + "targetType": "ALL", + }, + ], + "lintActions": [ + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trufflehog", + "paths": [ + "test_data/wrong_line_number.in.ts", + ], + "verb": "TRUNK_VERB_CHECK", + }, + { + "command": "lint", + "fileGroupName": "ALL", + "linter": "trufflehog", + "paths": [ + "test_data/wrong_line_number.in.ts", + ], + "upstream": true, + "verb": "TRUNK_VERB_CHECK", + }, + ], + "taskFailures": [], + "unformattedFiles": [], +} +`; diff --git a/package-lock.json b/package-lock.json index 20940b4eb..f61099fff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,20 +16,20 @@ "@types/debug": "^4.1.12", "@types/jest": "^29.5.14", "@types/jest-specific-snapshot": "^0.5.9", - "@types/node": "^22.10.1", + "@types/node": "^22.10.10", "@types/semver": "^7.5.8", - "@typescript-eslint/eslint-plugin": "^8.17.0", - "@typescript-eslint/parser": "^8.17.0", + "@typescript-eslint/eslint-plugin": "^8.21.0", + "@typescript-eslint/parser": "^8.21.0", "caller": "^1.1.0", "debug": "^4.4.0", "eslint": "9.14.0", - "eslint-config-prettier": "^9.1.0", + "eslint-config-prettier": "^10.0.1", "eslint-import-resolver-typescript": "^3.7.0", "eslint-plugin-import": "^2.31.0", - "eslint-plugin-import-x": "^4.5.0", - "eslint-plugin-jest": "^28.9.0", - "eslint-plugin-n": "^17.14.0", - "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-import-x": "^4.6.1", + "eslint-plugin-jest": "^28.11.0", + "eslint-plugin-n": "^17.15.1", + "eslint-plugin-prettier": "^5.2.3", "eslint-plugin-simple-import-sort": "^12.1.1", "fast-sort": "^3.4.1", "jest": "^29.3.1", @@ -40,9 +40,9 @@ "ts-jest": "^29.2.5", "ts-node": "^10.9.2", "tsconfig-paths": "^4.1.2", - "typescript": "^5.7.2", - "typescript-eslint": "^8.17.0", - "yaml": "^2.6.1" + "typescript": "^5.7.3", + "typescript-eslint": "^8.21.0", + "yaml": "^2.7.0" }, "engines": { "node": ">=16" @@ -1393,6 +1393,12 @@ "@types/ms": "*" } }, + "node_modules/@types/doctrine": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/@types/doctrine/-/doctrine-0.0.9.tgz", + "integrity": "sha512-eOIHzCUSH7SMfonMG1LsC2f8vxBFtho6NGBznK41R84YzPuvSBzrhEps33IsQiOW9+VL6NQ9DbjQJznk/S4uRA==", + "dev": true + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -1463,10 +1469,11 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", - "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", + "version": "22.10.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.10.tgz", + "integrity": "sha512-X47y/mPNzxviAGY5TcYPtYL8JsY3kAq2n8fMmKoRCxq/c4v4pyGNCzM2R6+M5/umG4ZfHuT+sgqDYqWc9rJ6ww==", "dev": true, + "license": "MIT", "dependencies": { "undici-types": "~6.20.0" } @@ -1496,20 +1503,21 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.17.0.tgz", - "integrity": "sha512-HU1KAdW3Tt8zQkdvNoIijfWDMvdSweFYm4hWh+KwhPstv+sCmWb89hCIP8msFm9N1R/ooh9honpSuvqKWlYy3w==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.21.0.tgz", + "integrity": "sha512-eTH+UOR4I7WbdQnG4Z48ebIA6Bgi7WO8HvFEneeYBxG8qCOYgTOFPSg6ek9ITIDvGjDQzWHcoWHCDO2biByNzA==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.17.0", - "@typescript-eslint/type-utils": "8.17.0", - "@typescript-eslint/utils": "8.17.0", - "@typescript-eslint/visitor-keys": "8.17.0", + "@typescript-eslint/scope-manager": "8.21.0", + "@typescript-eslint/type-utils": "8.21.0", + "@typescript-eslint/utils": "8.21.0", + "@typescript-eslint/visitor-keys": "8.21.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1520,24 +1528,21 @@ }, "peerDependencies": { "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.17.0.tgz", - "integrity": "sha512-Drp39TXuUlD49F7ilHHCG7TTg8IkA+hxCuULdmzWYICxGXvDXmDmWEjJYZQYgf6l/TFfYNE167m7isnc3xlIEg==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.21.0.tgz", + "integrity": "sha512-Wy+/sdEH9kI3w9civgACwabHbKl+qIOu0uFZ9IMKzX3Jpv9og0ZBJrZExGrPpFAY7rWsXuxs5e7CPPP17A4eYA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.17.0", - "@typescript-eslint/types": "8.17.0", - "@typescript-eslint/typescript-estree": "8.17.0", - "@typescript-eslint/visitor-keys": "8.17.0", + "@typescript-eslint/scope-manager": "8.21.0", + "@typescript-eslint/types": "8.21.0", + "@typescript-eslint/typescript-estree": "8.21.0", + "@typescript-eslint/visitor-keys": "8.21.0", "debug": "^4.3.4" }, "engines": { @@ -1548,22 +1553,19 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.17.0.tgz", - "integrity": "sha512-/ewp4XjvnxaREtqsZjF4Mfn078RD/9GmiEAtTeLQ7yFdKnqwTOgRMSvFz4et9U5RiJQ15WTGXPLj89zGusvxBg==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.21.0.tgz", + "integrity": "sha512-G3IBKz0/0IPfdeGRMbp+4rbjfSSdnGkXsM/pFZA8zM9t9klXDnB/YnKOBQ0GoPmoROa4bCq2NeHgJa5ydsQ4mA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.17.0", - "@typescript-eslint/visitor-keys": "8.17.0" + "@typescript-eslint/types": "8.21.0", + "@typescript-eslint/visitor-keys": "8.21.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1574,15 +1576,16 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.17.0.tgz", - "integrity": "sha512-q38llWJYPd63rRnJ6wY/ZQqIzPrBCkPdpIsaCfkR3Q4t3p6sb422zougfad4TFW9+ElIFLVDzWGiGAfbb/v2qw==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.21.0.tgz", + "integrity": "sha512-95OsL6J2BtzoBxHicoXHxgk3z+9P3BEcQTpBKriqiYzLKnM2DeSqs+sndMKdamU8FosiadQFT3D+BSL9EKnAJQ==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.17.0", - "@typescript-eslint/utils": "8.17.0", + "@typescript-eslint/typescript-estree": "8.21.0", + "@typescript-eslint/utils": "8.21.0", "debug": "^4.3.4", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1592,19 +1595,16 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/types": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.17.0.tgz", - "integrity": "sha512-gY2TVzeve3z6crqh2Ic7Cr+CAv6pfb0Egee7J5UAVWCpVvDI/F71wNfolIim4FE6hT15EbpZFVUj9j5i38jYXA==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.21.0.tgz", + "integrity": "sha512-PAL6LUuQwotLW2a8VsySDBwYMm129vFm4tMVlylzdoTybTHaAi0oBp7Ac6LhSrHHOdLM3efH+nAR6hAWoMF89A==", "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -1614,19 +1614,20 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.17.0.tgz", - "integrity": "sha512-JqkOopc1nRKZpX+opvKqnM3XUlM7LpFMD0lYxTqOTKQfCWAmxw45e3qlOCsEqEB2yuacujivudOFpCnqkBDNMw==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.21.0.tgz", + "integrity": "sha512-x+aeKh/AjAArSauz0GiQZsjT8ciadNMHdkUSwBB9Z6PrKc/4knM4g3UfHml6oDJmKC88a6//cdxnO/+P2LkMcg==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.17.0", - "@typescript-eslint/visitor-keys": "8.17.0", + "@typescript-eslint/types": "8.21.0", + "@typescript-eslint/visitor-keys": "8.21.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1635,10 +1636,8 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { @@ -1646,6 +1645,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -1655,6 +1655,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -1666,15 +1667,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.17.0.tgz", - "integrity": "sha512-bQC8BnEkxqG8HBGKwG9wXlZqg37RKSMY7v/X8VEWD8JG2JuTHuNK0VFvMPMUKQcbk6B+tf05k+4AShAEtCtJ/w==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.21.0.tgz", + "integrity": "sha512-xcXBfcq0Kaxgj7dwejMbFyq7IOHgpNMtVuDveK7w3ZGwG9owKzhALVwKpTF2yrZmEwl9SWdetf3fxNzJQaVuxw==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.17.0", - "@typescript-eslint/types": "8.17.0", - "@typescript-eslint/typescript-estree": "8.17.0" + "@typescript-eslint/scope-manager": "8.21.0", + "@typescript-eslint/types": "8.21.0", + "@typescript-eslint/typescript-estree": "8.21.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1684,21 +1686,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.17.0.tgz", - "integrity": "sha512-1Hm7THLpO6ww5QU6H/Qp+AusUUl+z/CAm3cNZZ0jQvon9yicgO7Rwd+/WWRpMKLYV6p2UvdbR27c86rzCPpreg==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.21.0.tgz", + "integrity": "sha512-BkLMNpdV6prozk8LlyK/SOoWLmUFi+ZD+pcqti9ILCbVvHGk1ui1g4jJOc2WDLaeExz2qWwojxlPce5PljcT3w==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/types": "8.21.0", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -1714,6 +1713,7 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -2769,11 +2769,12 @@ } }, "node_modules/eslint-config-prettier": { - "version": "9.1.0", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.0.1.tgz", + "integrity": "sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw==", "dev": true, - "license": "MIT", "bin": { - "eslint-config-prettier": "bin/cli.js" + "eslint-config-prettier": "build/bin/cli.js" }, "peerDependencies": { "eslint": ">=7.0.0" @@ -2912,15 +2913,17 @@ } }, "node_modules/eslint-plugin-import-x": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.5.0.tgz", - "integrity": "sha512-l0OTfnPF8RwmSXfjT75N8d6ZYLVrVYWpaGlgvVkVqFERCI5SyBfDP7QEMr3kt0zWi2sOa9EQ47clbdFsHkF83Q==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.6.1.tgz", + "integrity": "sha512-wluSUifMIb7UfwWXqx7Yx0lE/SGCcGXECLx/9bCmbY2nneLwvAZ4vkd1IXDjPKFvdcdUgr1BaRnaRpx3k2+Pfw==", "dev": true, "dependencies": { + "@types/doctrine": "^0.0.9", "@typescript-eslint/scope-manager": "^8.1.0", "@typescript-eslint/utils": "^8.1.0", "debug": "^4.3.4", "doctrine": "^3.0.0", + "enhanced-resolve": "^5.17.1", "eslint-import-resolver-node": "^0.3.9", "get-tsconfig": "^4.7.3", "is-glob": "^4.0.3", @@ -3018,9 +3021,9 @@ } }, "node_modules/eslint-plugin-jest": { - "version": "28.9.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.9.0.tgz", - "integrity": "sha512-rLu1s1Wf96TgUUxSw6loVIkNtUjq1Re7A9QdCCHSohnvXEBAjuL420h0T/fMmkQlNsQP2GhQzEUpYHPfxBkvYQ==", + "version": "28.11.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.11.0.tgz", + "integrity": "sha512-QAfipLcNCWLVocVbZW8GimKn5p5iiMcgGbRzz8z/P5q7xw+cNEpYqyzFMtIF/ZgF2HLOyy+dYBut+DoYolvqig==", "dev": true, "dependencies": { "@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0" @@ -3043,11 +3046,10 @@ } }, "node_modules/eslint-plugin-n": { - "version": "17.14.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.14.0.tgz", - "integrity": "sha512-maxPLMEA0rPmRpoOlxEclKng4UpDe+N5BJS4t24I3UKnN109Qcivnfs37KMy84G0af3bxjog5lKctP5ObsvcTA==", + "version": "17.15.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.15.1.tgz", + "integrity": "sha512-KFw7x02hZZkBdbZEFQduRGH4VkIH4MW97ClsbAM4Y4E6KguBJWGfWG1P4HEIpZk2bkoWf0bojpnjNAhYQP8beA==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.1", "enhanced-resolve": "^5.17.1", @@ -3105,9 +3107,9 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", - "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.3.tgz", + "integrity": "sha512-qJ+y0FfCp/mQYQ/vWQ3s7eUlFEL4PyKfAJxsnYTJ4YT73nsJBWqmEpFryxV9OeUiqmsTsYJ5Y+KDNaeP31wrRw==", "dev": true, "dependencies": { "prettier-linter-helpers": "^1.0.0", @@ -6088,14 +6090,15 @@ } }, "node_modules/ts-api-utils": { - "version": "1.3.0", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.0.tgz", + "integrity": "sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==", "dev": true, - "license": "MIT", "engines": { - "node": ">=16" + "node": ">=18.12" }, "peerDependencies": { - "typescript": ">=4.2.0" + "typescript": ">=4.8.4" } }, "node_modules/ts-jest": { @@ -6308,11 +6311,10 @@ } }, "node_modules/typescript": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", - "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", "dev": true, - "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -6322,14 +6324,15 @@ } }, "node_modules/typescript-eslint": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.17.0.tgz", - "integrity": "sha512-409VXvFd/f1br1DCbuKNFqQpXICoTB+V51afcwG1pn1a3Cp92MqAUges3YjwEdQ0cMUoCIodjVDAYzyD8h3SYA==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.21.0.tgz", + "integrity": "sha512-txEKYY4XMKwPXxNkN8+AxAdX6iIJAPiJbHE/FpQccs/sxw8Lf26kqwC3cn0xkHlW8kEbLhkhCsjWuMveaY9Rxw==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.17.0", - "@typescript-eslint/parser": "8.17.0", - "@typescript-eslint/utils": "8.17.0" + "@typescript-eslint/eslint-plugin": "8.21.0", + "@typescript-eslint/parser": "8.21.0", + "@typescript-eslint/utils": "8.21.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -6339,12 +6342,8 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/unbox-primitive": { @@ -6540,11 +6539,10 @@ "license": "ISC" }, "node_modules/yaml": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", - "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", "dev": true, - "license": "ISC", "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index ef776cfbd..aaf3e6c6f 100644 --- a/package.json +++ b/package.json @@ -14,20 +14,20 @@ "@types/debug": "^4.1.12", "@types/jest": "^29.5.14", "@types/jest-specific-snapshot": "^0.5.9", - "@types/node": "^22.10.1", + "@types/node": "^22.10.10", "@types/semver": "^7.5.8", - "@typescript-eslint/eslint-plugin": "^8.17.0", - "@typescript-eslint/parser": "^8.17.0", + "@typescript-eslint/eslint-plugin": "^8.21.0", + "@typescript-eslint/parser": "^8.21.0", "caller": "^1.1.0", "debug": "^4.4.0", "eslint": "9.14.0", - "eslint-config-prettier": "^9.1.0", + "eslint-config-prettier": "^10.0.1", "eslint-import-resolver-typescript": "^3.7.0", "eslint-plugin-import": "^2.31.0", - "eslint-plugin-import-x": "^4.5.0", - "eslint-plugin-jest": "^28.9.0", - "eslint-plugin-n": "^17.14.0", - "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-import-x": "^4.6.1", + "eslint-plugin-jest": "^28.11.0", + "eslint-plugin-n": "^17.15.1", + "eslint-plugin-prettier": "^5.2.3", "eslint-plugin-simple-import-sort": "^12.1.1", "fast-sort": "^3.4.1", "jest": "^29.3.1", @@ -38,9 +38,9 @@ "ts-jest": "^29.2.5", "ts-node": "^10.9.2", "tsconfig-paths": "^4.1.2", - "typescript": "^5.7.2", - "typescript-eslint": "^8.17.0", - "yaml": "^2.6.1" + "typescript": "^5.7.3", + "typescript-eslint": "^8.21.0", + "yaml": "^2.7.0" }, "bundleDependencies": [ "tests"