stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

build: ensure only errors are displayed in issue via log file

Open Planeshifter opened this issue 11 months ago • 3 comments

Description

What is the purpose of this pull request?

This pull request:

  • adds support for an ESLINT_ERROR_LOG variable to store errors when running eslint-files make rule.

Using the JSON formatter as suggested in the issue and discussed doesn't help much since we process each file individually and would then still need to parse out the results for them. Instead, I ended up settling on re-running the ESLint command with --quiet to ensure only errors get reported and appending the results to a log file whenever linting of a file fails.

Related Issues

Does this pull request have any related issues?

This pull request:

  • resolves https://github.com/stdlib-js/metr-issue-tracker/issues/45.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

Planeshifter avatar Mar 03 '25 02:03 Planeshifter

Using the JSON formatter as suggested in the issue and discussed doesn't help much since we process each file individually and would then still need to parse out the results for them

Why wasn't the Unix formatter suitable?

kgryte avatar Mar 04 '25 00:03 kgryte

@kgryte

If we used the Unix formatter, we would get output like

/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js:1:10: 'addOne' is defined but never used. [Error/no-unused-vars]

We could implement this and then use grep to filter lines containing [Error. However, I find this output less appealing than the default formatting. Second, we would need to maintain the previous tee approach in order to print to both stdout and a file then. Finally, we would need to either use a deprecated ESLint formatter (no longer available in v9) or add that external dependency. In comparison, I find the make rule variable for storing errors simple and clear.

Planeshifter avatar Mar 04 '25 02:03 Planeshifter

@Planeshifter Would it be possible to move this PR along? Would help to minimize some of the PR noise we are experiencing for the lint issues.

kgryte avatar May 31 '25 22:05 kgryte