angular / angular/dev-infra

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

Offen
#2,346 0 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @josephperrott Auf GitHub ansehen
area: build & ci P3
Vorherrschende Sprache
JavaScript
Sterne
77
Forks
83
Ø Merge
2 T. 5 Std.
Gemergte PRs (30 T.)
37

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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