forcedotcom / forcedotcom/code-analyzer

[Feature Request] Config check CLI commands for external config files

Offen
#2,029 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
240
Forks
52
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
5

Beschreibung

### Product Area

The "code-analyzer" CLI

### Your Need or Problem

Currently, when I recreate my config file (after modifying my custom PMD ruleset), it gives an error if my PMD file has a problem.

This is good.

However, it would be BETTER if I could run a code-analyzer command that would validate my PMD files that are mentioned in my config file WITHOUT regenerating my config file. It would just be simpler while I'm updating things. Then I would, of course, have to redo the config command.

### Your Desired Solution

Please add a command

`sf code-analyzer config check --engine pmd,eslint --config-file code-analyzer.yml`

that looks at the PMD rulesets referenced in `code-analyzer.yml` and runs `pmd --debug check -d -R -f text` or a similar command.

For the ESLint config referenced in `code-analyzer.yml` it runs `npx eslint --inspect-config` or a similar command.

I **know** that rulesets/configs are validated when listing rules, but I don't want any output beyond "Your config file is valid" or "These are the problems in your config file" for this request.

### Alternatives Considered

1. Run `echo 'y' | sf code-analyzer config --include-unmodified-rules --rule-selector all --config-file code-analyzer.yml --output-file code-analyzer.yml` to regenerate `code-analyzer.yml`
2. Run `sf code-analyzer rules --rule-selector pmd --rule-selector eslint`

### Additional Context (Screenshots, Files, etc)

_No response_

### Workaround

I can do what I want within other commands, but breaking it out would speed some work.

### Urgency

Low

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie beim bestehenden config-Befehl der code-analyzer CLI und der Verarbeitung von config-file; vergleichen Sie, wie PMD rulesets und ESLint configs derzeit validiert werden, wenn Regeln neu generiert oder aufgelistet werden. Die Aufgabe ist erfüllt, wenn ein config check-Befehl die angegebenen Optionen akzeptiert und nur Gültigkeits- oder Konfigurationsprobleme für die ausgewählten Engines meldet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
eslint, typescript
Bereich
cli, tooling
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.