Skip to content

fix(codacy): resolve open code-scanning alerts - #167

Merged
ThePlenkov merged 2 commits into
mainfrom
devin/fix-code-scanning-alerts
Aug 12, 2026
Merged

fix(codacy): resolve open code-scanning alerts#167
ThePlenkov merged 2 commits into
mainfrom
devin/fix-code-scanning-alerts

Conversation

@ThePlenkov

@ThePlenkov ThePlenkov commented Aug 12, 2026

Copy link
Copy Markdown
Member

User description

Summary

Resolves the open code-scanning alerts reported by Codacy.

Root causes

  • prompt-secrets.sh: trap used double quotes, so $temp_file expanded at trap definition time instead of at signal time (shellcheck SC2064).
  • jest.preset.js: JSHint defaulted to ES5 and flagged const/object spread; added an esversion directive.
  • website/src/css/custom.css: CSSLint does not support CSS custom properties (--ifm-*), producing false-positive parse errors.
  • Generated CHANGELOG.md files and .github/prompts/*.prompt.md contain bracket placeholders ([bot], [instructions], etc.) that remark-lint treats as undefined/shortcut references.
  • Source docs/skills/AGENTS/openspec files used bare literal URLs or bracket labels ([#N], [Risk], [DEPRECATED]) that triggered remark-lint.

Changes

  • Fixed the trap command to use single quotes and deferred variable expansion.
  • Added /* jshint esversion: 9 */ to jest.preset.js.
  • Added .codacy.yml to exclude generated CHANGELOG.md files, prompt frontmatter, and website/src/css/custom.css from the noisy Codacy checks.
  • Escaped bracket placeholders and wrapped literal URLs in source markdown files.
  • Converted workflow/command frontmatter tags: [...] arrays to YAML list syntax so remark-lint no longer sees them as shortcut reference links.

Link to Devin session: https://app.devin.ai/sessions/68e46e97ea5847d8a4c3f38062ef1f13
Requested by: @ThePlenkov


Summary by cubic

Fixes all open Codacy code-scanning alerts. Cleans up shell, JS, and Markdown issues to reduce false positives and keep scans green.

  • Bug Fixes
    • Shell: fixed deferred variable expansion in prompt-secrets.sh trap.
    • JS lint: added /* jshint esversion: 9 */ to jest.preset.js.
    • Codacy: added .codacy.yml to exclude website/src/css/custom.css, **/CHANGELOG.md, and .github/prompts/*.prompt.md.
    • Docs: escaped bracket placeholders, wrapped bare URLs in angle brackets, and removed a stale Turborepo migration anchor.
    • Frontmatter: converted tags: [...] arrays to YAML lists to avoid remark-lint shortcut link errors.

Written for commit 0de9d34. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Documentation

    • Improved Markdown formatting for links, references, and risk descriptions across guides and roadmap content.
    • Added spacing improvements to planning documentation.
    • Clarified the deprecated status of the --folder-logic CLI option without changing its behavior.
  • Maintenance

    • Standardized workflow and command metadata formatting.
    • Added linting exclusions for generated or specialized documentation files.
    • Improved temporary-file cleanup reliability.
    • Added compatibility guidance for modern JavaScript syntax.

CodeAnt-AI Description

Resolve code-scanning findings and keep project checks passing

What Changed

  • Prevents the secret-scanning hook from using an outdated temporary-file path during cleanup
  • Keeps JavaScript linting compatible with the modern syntax used by the Jest configuration
  • Updates Markdown links, placeholders, warnings, and metadata so documentation checks no longer treat them as broken references
  • Excludes generated changelogs, prompt templates, and unsupported CSS syntax from noisy scans

Impact

✅ Reliable temporary-file cleanup in secret scanning
✅ Cleaner code-scanning results
✅ Fewer documentation lint failures

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

- Fix shellcheck SC2064 trap expansion in prompt-secrets.sh

- Add jshint esversion directive to jest.preset.js

- Add .codacy.yml to exclude generated/noise files from csslint and remark-lint

- Escape bracket placeholders and wrap literal URLs in source markdown files

- Convert workflow/command frontmatter tags arrays to YAML lists

Co-Authored-By: Petr Plenkov <petr.plenkov@gmail.com>
@ThePlenkov ThePlenkov self-assigned this Aug 12, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@netlify

netlify Bot commented Aug 12, 2026

Copy link
Copy Markdown

Deploy Preview for adt-cli canceled.

Name Link
🔨 Latest commit 0de9d34
🔍 Latest deploy log https://app.netlify.com/projects/adt-cli/deploys/6a7c27e6ca1b790008fd7a07

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR successfully resolves the Codacy code-scanning alerts through targeted fixes:

Key Changes:

  • Fixed shell script trap command to use single quotes for proper deferred variable expansion (SC2064 fix)
  • Added JSHint ES9 directive to support modern JavaScript syntax
  • Created .codacy.yml to exclude false positives from CSS custom properties and generated files
  • Updated markdown files to use YAML list syntax and angle-bracketed URLs for remark-lint compliance

All changes are working correctly and address legitimate linting issues without introducing defects. The shell script fix in particular addresses a real bug where $temp_file would expand prematurely.

Approval Status: No blocking issues identified. The changes are focused, well-documented, and ready to merge.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request standardizes Markdown URL formatting across guidance and documentation, converts metadata tags to multiline YAML lists, adds lint exclusions and an ES2021 directive, adjusts shell trap quoting, and updates several Markdown presentation details.

Changes

Formatting normalization

Layer / File(s) Summary
Reference link formatting
.agents/skills/..., docs/..., packages/...
Reference URLs now use Markdown autolinks or links.
Metadata and tooling normalization
.agents/workflows/..., .claude/commands/..., .claude/hooks/..., .codacy.yml, jest.preset.js
Tags use multiline YAML lists. Tooling exclusions and syntax metadata were added. The temporary-file cleanup trap now preserves deferred variable expansion.
Document presentation updates
docs/planning/..., openspec/..., website/docs/cli/import.md
Planning spacing, risk labels, and the --folder-logic deprecation label were reformatted.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: baz-reviewer

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: resolving open Codacy code-scanning alerts.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch devin/fix-code-scanning-alerts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remark-lint (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@nx-cloud

nx-cloud Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit a68941d

Command Status Duration Result
nx affected -t lint test build e2e-ci --verbose... ✅ Succeeded 1m 41s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-12 08:02:02 UTC

@ThePlenkov
ThePlenkov marked this pull request as ready for review August 12, 2026 07:50
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/nx-import/references/TURBOREPO.md:
- Line 4: Update the migration guide link in TURBOREPO.md to remove the stale
`#easy-automated-migration-example` fragment, leaving the base Nx from-Turborepo
URL unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 780a5632-418c-4285-a72c-33ffd7660477

📥 Commits

Reviewing files that changed from the base of the PR and between 3ccdeac and a68941d.

📒 Files selected for processing (29)
  • .agents/skills/add-endpoint/SKILL.md
  • .agents/skills/add-object-type/SKILL.md
  • .agents/skills/adt-reverse-engineering/SKILL.md
  • .agents/skills/nx-import/SKILL.md
  • .agents/skills/nx-import/references/GRADLE.md
  • .agents/skills/nx-import/references/TURBOREPO.md
  • .agents/workflows/lint.md
  • .agents/workflows/opsx-apply.md
  • .agents/workflows/opsx-archive.md
  • .agents/workflows/opsx-explore.md
  • .agents/workflows/opsx-propose.md
  • .claude/commands/opsx/apply.md
  • .claude/commands/opsx/archive.md
  • .claude/commands/opsx/explore.md
  • .claude/commands/opsx/propose.md
  • .claude/hooks/sonar-secrets/build-scripts/prompt-secrets.sh
  • .codacy.yml
  • docs/README.md
  • docs/planning/abap-code-review.md
  • docs/planning/current-sprint.md
  • docs/roadmap/README.md
  • docs/roadmap/epics/e06-gcts-format-plugin.md
  • docs/roadmap/epics/e09-acds-parser.md
  • docs/roadmap/epics/e13-startrfc.md
  • jest.preset.js
  • openspec/changes/arc-1-feature-parity/design.md
  • packages/adt-client/AGENTS.md
  • packages/ts-xsd/AGENTS.md
  • website/docs/cli/import.md

Comment thread .agents/skills/nx-import/references/TURBOREPO.md Outdated
@baz-reviewer

baz-reviewer Bot commented Aug 12, 2026

Copy link
Copy Markdown

Merger

Needs Review

The changes include executable shell and lint configuration updates, but no CI run was recorded to verify them. Human review is needed before merging.

Commit 0de9d34 · Evaluated 2026-08-12 08:05 UTC

Review this PR on Baz | Customize your next review

CodeRabbit noted the target page redirects and the anchor no longer exists.

Co-Authored-By: Petr Plenkov <petr.plenkov@gmail.com>
@codeant-ai

codeant-ai Bot commented Aug 12, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 0de9d34 Aug 12, 2026 · 07:59 08:01

@codeant-ai

codeant-ai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@gitar-bot

gitar-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Aug 12, 2026
@ThePlenkov
ThePlenkov merged commit a69455f into main Aug 12, 2026
27 checks passed
@ThePlenkov
ThePlenkov deleted the devin/fix-code-scanning-alerts branch August 12, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

baz: needs review size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants