angular / angular/dev-infra

dev-infra: linting fails for `BUILD.bazel` file and `ng-dev format files` does not fix the failure

Aperta
#2,346 0 commenti 0 reazioni 1 assegnatario Rivendicata da @josephperrott Vedi su GitHub
area: build & ci P3
Lingua principale
JavaScript
Stelle
77
Fork
83
Merge medio
2g 5h
PR unite (30g)
37

Descrizione

In angular/angular#40621, we run into a situation where the `ng-dev format ... --check` command (run as part of the `lint` job on CI) finds some formatting issues with a `BAZEL.build` file and fails. It suggests (or prompts the user) to run `ng-dev format files ...` to fix the issue, but that command does not fix the linting failure.

In that case, the problem was a glob pattern that included a constant string (see https://github.com/angular/angular/pull/40621#issuecomment-772482472). The fix was to manually change the pattern as follows:

```diff
-srcs = glob(["constant.string", "glob/*.pattern"]),
+srcs = ["constant.string"] + glob(["glob/*.pattern"]),
```

##
Not sure what is the best way to fix this. Ideally, we should suggest (or prompt the user) to run a command that actually fixes the error. If there is no such command, we should at least show the error message, so users can figure out how to manually fix it themselves.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.