forcedotcom / forcedotcom/code-analyzer

[Feature Request] File based regex rules

Abierto
#1,972 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
240
Forks
52
Merge medio
1 d 23 h
PR fusionados (30 d)
5

Descripción

### Product Area

The "code-analyzer" CLI

### Your Need or Problem

Allow for regex rules to be placed into their own files and referenced from `code-analyzer.yml` so that they can be more easily shared between projects instead of merging them into existing files.

### Your Desired Solution

Lets say we had the rule:
```yaml
name: Salesforce Code Analyzer Configuration
version: 1.0.0

rulesets: []

engines:
regex:
custom_rules:
ProhibitSuppressWarnings:
regex: /@SuppressWarnings\([^)]*\)|\/\/\s*NOPMD/gi
file_extensions: ['.apex', '.cls', '.trigger']
description:
'Prohibits the use of @SuppressWarnings annotations and
NOPMD comments in Apex code. Suppressions hide code quality
issues; prefer fixing the underlying problems or improving
rules instead.'
violation_message:
'Suppression of warnings is not allowed. Fix the underlying
issue or improve the rule instead of suppressing violations.'
severity: 'High'
tags: ['CodeStyle', 'Recommended']
```
I would like to take the details of that rule and put them in a different .yaml file, then refer to that .yaml file from code-analyzer.yml

### Alternatives Considered

Keep adding rules to code-analyzer.yml like today, using a pre-processor/script ahead of every run, etc

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

_No response_

### Workaround

_No response_

### Urgency

Low

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.