Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(linter): move finishing default diagnostic message to GraphicalReporter #8683

Conversation

Sysix
Copy link
Collaborator

@Sysix Sysix commented Jan 23, 2025

Now every lint output is owned by is right OutputFormatter and his DiagnosticReporter 🥳
Next step is to setup a snapshot Tester, so I can remove the ToDos.

Reorded some lines so the outfor is now for: cargo run -p oxlint -- test.js --max-warnings=2

Found 4 warnings and 0 errors.
Exceeded maximum number of warnings. Found 4.
Finished in 5ms on 1 file with 97 rules using 24 threads.

and for cargo run -p oxlint -- test.js

Found 4 warnings and 0 errors.
Finished in 5ms on 1 file with 97 rules using 24 threads.

The output time and warnings/error count wil be always printed.

@github-actions github-actions bot added A-cli Area - CLI C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Jan 23, 2025
Copy link
Collaborator Author

Sysix commented Jan 23, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Sysix Sysix marked this pull request as ready for review January 23, 2025 20:43
@Sysix Sysix marked this pull request as draft January 23, 2025 20:44
@Sysix Sysix force-pushed the 01-23-refactor_linter_move_finishing_default_diagnostic_message_to_graphicalreporter_ branch 2 times, most recently from 205cdf0 to d787cf5 Compare January 23, 2025 23:12
Copy link

codspeed-hq bot commented Jan 23, 2025

CodSpeed Performance Report

Merging #8683 will not alter performance

Comparing 01-23-refactor_linter_move_finishing_default_diagnostic_message_to_graphicalreporter_ (10e5920) with main (b977678)

Summary

✅ 32 untouched benchmarks

@Sysix Sysix marked this pull request as ready for review January 24, 2025 13:37
@Sysix Sysix force-pushed the 01-23-refactor_linter_move_finishing_default_diagnostic_message_to_graphicalreporter_ branch from 2f934d2 to 208df78 Compare January 24, 2025 14:19
apps/oxlint/src/lint.rs Outdated Show resolved Hide resolved
apps/oxlint/src/result.rs Outdated Show resolved Hide resolved
@Sysix Sysix force-pushed the 01-23-refactor_linter_move_finishing_default_diagnostic_message_to_graphicalreporter_ branch from 208df78 to 1279fef Compare January 24, 2025 16:28
@Sysix
Copy link
Collaborator Author

Sysix commented Jan 24, 2025

implemented the requested changes :)

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jan 24, 2025
Copy link
Member

Boshen commented Jan 24, 2025

Merge activity

  • Jan 24, 11:38 AM EST: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jan 24, 11:38 AM EST: A user added this pull request to the Graphite merge queue.
  • Jan 24, 11:43 AM EST: A user merged this pull request with the Graphite merge queue.

…icalReporter` (#8683)

Now every lint output is owned by is right OutputFormatter and his DiagnosticReporter 🥳
Next step is to setup a snapshot Tester, so I can remove the ToDos.

Reorded some lines so the outfor is now for: `cargo run -p oxlint -- test.js --max-warnings=2`
```
Found 4 warnings and 0 errors.
Exceeded maximum number of warnings. Found 4.
Finished in 5ms on 1 file with 97 rules using 24 threads.
```

and for `cargo run -p oxlint -- test.js`

```
Found 4 warnings and 0 errors.
Finished in 5ms on 1 file with 97 rules using 24 threads.
```

The output time and warnings/error count wil be always printed.
@Boshen Boshen force-pushed the 01-23-refactor_linter_move_finishing_default_diagnostic_message_to_graphicalreporter_ branch from 1279fef to 10e5920 Compare January 24, 2025 16:39
@graphite-app graphite-app bot merged commit 10e5920 into main Jan 24, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 01-23-refactor_linter_move_finishing_default_diagnostic_message_to_graphicalreporter_ branch January 24, 2025 16:43
Boshen added a commit that referenced this pull request Jan 26, 2025
## [0.48.1] - 2025-01-26

### Features

- b7f13e6 ast: Implement utf8 to utf16 span converter (#8687) (Boshen)
- 6589c3b mangler: Reuse variable names (#8562) (翠 / green)
- 29bd215 minifier: Minimize `Infinity.toString(radix)` to `'Infinity'`
(#8732) (Boshen)
- e0117db minifier: Replace `const` with `let` for non-exported
read-only variables (#8733) (sapphi-red)
- 9e32f55 minifier: Evaluate `Math.sqrt` and `Math.cbrt` (#8731)
(sapphi-red)
- 360d49e minifier: Replace `Math.pow` with `**` (#8730) (sapphi-red)
- 2e9a560 minifier: `NaN.toString(radix)` is always `NaN` (#8727)
(Boshen)
- cbe0e82 minifier: Minimize `foo(...[])` -> `foo()` (#8726) (Boshen)
- e9fb5fe minifier: Dce pure expressions such as `new Map()` (#8725)
(Boshen)

### Bug Fixes

- 0944758 codegen: Remove parens from `new (import(''), function() {})`
(#8707) (Boshen)
- 33de70a mangler: Handle cases where a var is declared in a block scope
(#8706) (翠 / green)
- d982cdb minifier: `Unknown.fromCharCode` should not be treated as
`String.fromCharCode` (#8709) (sapphi-red)
- e7ab96c transformer/jsx: Incorrect `isStaticChildren` argument for
`Fragment` with multiple children (#8713) (Dunqing)
- 3e509e1 transformer/typescript: Enum merging when same name declared
in outer scope (#8691) (branchseer)

### Performance

- dc0b0f2 manger: Remove useless `tmp_bindings` (#8735) (Dunqing)
- e472ced mangler: Optimize handling of collecting lived scope ids
(#8724) (Dunqing)
- 8587965 minifier: Normalize `undefined` to `void 0` before everything
else (#8699) (Boshen)

### Refactor

- 58002e2 ecmascript: Remove the lifetime annotation on
`MayHaveSideEffects` (#8717) (Boshen)
- 10e5920 linter: Move finishing default diagnostic message to
`GraphicalReporter` (#8683) (Sysix)
- 52a37d0 mangler: Simplify initialization of `slots` (#8734) (Dunqing)
- 6bc906c minifier: Allow mutating arguments in methods called from
`try_fold_known_string_methods` (#8729) (sapphi-red)
- bf8be23 minifier: Use `Ctx` (#8716) (Boshen)
- 0af0267 minifier: Side effect detection needs symbols resolution
(#8715) (Boshen)
- 32e0e47 minifier: Clean up `Normalize` (#8700) (Boshen)
- c792068 semantic: Simplify `ScopeTree::iter_bindings` (#8723)
(Dunqing)

### Testing

- 03229c5 minifier: Fix broken tests (#8722) (Boshen)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
@oxc-bot oxc-bot mentioned this pull request Feb 1, 2025
Boshen added a commit that referenced this pull request Feb 1, 2025
## [0.15.9] - 2025-02-01

### Features

- 1a41181 linter: Implement `eslint/prefer-object-spread` (#8216)
(tbashiyy)
- adb8ebd linter: Implement no-useless-call rule (#8789) (keita hino)
- 3790933 linter: Add vitest/prefer-lowercase-title rule (#8152) (Tyler
Earls)
- e8e6917 linter: Unicorn/switch-cases-braces support options (#8704)
(1zumii)

### Bug Fixes

- 8ce21d1 linter: Can't disable `no-nested-ternary` rule anymore (#8600)
(dalaoshu)
- e929f26 linter: Output `LintCommandInfo` for
`CliRunResult::LintNoFilesFound` (#8714) (Sysix)
- 4f30a17 linter: Unicorn/switch-case-braces mangles code when applying
fix (#8758) (Tyler Earls)
- 9cc9d5f linter: `ignorePatterns` does not work when files are provided
as command arguments (#8590) (dalaoshu)
- 1de6f85 linter: No-lone-blocks erroring on block statements containing
comments (#8720) (Tyler Earls)
- 77ef61a linter: Fix diagnostic spans for `oxc/no-async-await` (#8721)
(camchenry)
- f15bdce linter: Catch `Promise` in `typescript/array-type` rule
(#8702) (Rintaro Itokawa)
- 5041cb3 vscode: Fix commands by reverting commit `259a47b` (#8819)
(Alexander S.)

### Performance

- d318238 linter: Remove sorting of rules in cache (#8718) (camchenry)

### Documentation

- 57b7ca8 ast: Add documentation for all remaining JS AST methods
(#8820) (Cam McHenry)

### Refactor

- c2fdfc4 linter: Correctly handle loose options for `eslint/eqeqeq`
(#8798) (dalaoshu)
- 0aeaedd linter: Support loose options for `eslint/eqeqeq` (#8790)
(dalaoshu)
- 194a5ff linter: Remove `LintResult` (#8712) (Sysix)
- 4a2f2a9 linter: Move default `all_rules` output to trait (#8710)
(Sysix)
- 741fb40 linter: Move stdout outside LintRunner (#8694) (Sysix)
- 10e5920 linter: Move finishing default diagnostic message to
`GraphicalReporter` (#8683) (Sysix)
- 9731c56 oxlint: Move output from `CliRunResult::InvalidOption` to
outside and use more Enums for different invalid options (#8778) (Sysix)
- fe45bee oxlint: Create different `CliRunResult` instead of passing
`ExitCode` to it (#8777) (Sysix)
- 2378fef oxlint: Move ConfigFileInit output outside CliRunResult, exit
code 1 when it fails (#8776) (Sysix)
- f4cecb5 oxlint: Remove unused `CliRunResult::PathNotFound` (#8775)
(Sysix)

### Testing

- ad35e82 linter: Use snapshot testing instead of LintResult (#8711)
(Sysix)
- bf895eb linter: Add diagnostic format test snapshots (#8696)
(Alexander S.)
- 34d3d72 linter: Add snapshot tester for cli (#8695) (Sysix)
- 0bf2bcf oxlint: Test two real rules with same name but from different
plugins (#8821) (dalaoshu)
- 2b83b71 oxlint: Improve disabling "no-nested-ternary" tests (#8814)
(Alexander S.)
- 45648e7 oxlint: Fix InvalidOptionTsConfig tests for windows (#8791)
(Alexander S.)
- 48bfed9 oxlint: Ignore windows path mismatch (Boshen)
- 6f4a023 oxlint: Remove "--print-config" test (#8792) (Sysix)
- 55c2025 oxlint: Add `CliRunResult` to snapshot (#8780) (Sysix)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue A-cli Area - CLI C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants