angular / angular/dev-infra

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

Open
#2,346 0 comments 0 reactions 1 assignee Claimed by @josephperrott View on GitHub
area: build & ci P3
Dominant language
JavaScript
Stars
77
Forks
83
Avg merge
2d 5h
Merged PRs (30d)
37

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.