Skip to content

feat(tools): import as autoconfig and skip what Codacy's defaults cover OD-1406 - #74

Open
manufacturist wants to merge 1 commit into
feat/od-1268-import-exclude-as-ignore-rulesfrom
feat/od-1406-import-autoconfig-source
Open

manufacturist wants to merge 1 commit into
feat/od-1268-import-exclude-as-ignore-rulesfrom
feat/od-1406-import-autoconfig-source

Conversation

@manufacturist

Copy link
Copy Markdown
Contributor

Stacked on #73.

The auto-configuration skill imports its paths with tools --import, but every rule was recorded as added by a person. The import also added the Codacy defaults that init --auto writes into exclude as duplicate rules, because defaults aren't stored. OD-1406

  • --source autoconfig records the rules with source autoconfig and reason "Auto-configuration". Without it nothing changes.

  • Patterns that Codacy's defaults already cover aren't sent, and are counted in one line. The check is on what a pattern matches, since init --auto writes the defaults as ordinary globs. The lists mirror foundation's CodacyDefaultIgnores.

  • Test on dev: init --auto, then tools --import .codacy/auto.config.json --source autoconfig

@codacy-production

codacy-production Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 75 complexity · 0 duplication

Metric Results
Complexity 75
Duplication 0

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

⚠️ Resolve issues before merging

A high-severity logic defect causes patterns containing brace alternatives to be incorrectly skipped when only one branch matches a Codacy default. This can prevent uncovered ignore rules from being sent to the API.

Codacy also found:

  • Complexity warnings in src/utils/import-ignore-rules.ts for planIgnoreRules and printIgnoreRulesOutcome.

Test suggestions

  • Autoconfig imports send source autoconfig and reason Auto-configuration.
  • Invalid sources and source usage without import are rejected.
  • Default-covered patterns are detected across representative folder, filename, glob, and negation patterns.
  • Default-covered patterns are omitted from the planned rules while uncovered patterns remain.
  • The source and reason are included on every rule in every API batch.
  • The reported default-covered count is included alongside added, existing, and skipped rule results.

TIP How was this review? Give us feedback

Comment on lines +129 to +131
return segments.slice(0, -1).some((segment) => {
const folder = literalOf(segment);
return folder !== undefined && DEFAULT_IGNORED_FOLDERS.some((f) => folder.endsWith(f));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 HIGH RISK

A pattern such as {foo/vendor/**,src/**} is skipped even though its src/** branch is not covered by the defaults. The folder check sees vendor without accounting for the enclosing brace alternative. Consider expanding alternatives before checking coverage, or conservatively retaining patterns with cross-segment alternatives.

TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.

@manufacturist
manufacturist added this pull request to stack #75 December 2, 2026 16:11
@manufacturist

Copy link
Copy Markdown
Contributor Author

Tested. Please merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants