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: error reporting #21

Merged
merged 4 commits into from
Jul 11, 2024
Merged

refactor: error reporting #21

merged 4 commits into from
Jul 11, 2024

Conversation

loichyan
Copy link
Owner

Use miette to report diagnostics, as codespan_reporting has not been actively maintained for a while. This should also fix #18: Currently, all checked files are persisted in the memory (check here), leading to memory leaks.

This PR also introduces binary files filtering, which significantly reduces "Invalid UTF-8" errors.

@loichyan loichyan mentioned this pull request Jul 11, 2024
@loichyan loichyan merged commit 4e007e9 into main Jul 11, 2024
3 checks passed
@loichyan loichyan deleted the refactor/error-reporting branch July 12, 2024 14:24
loichyan added a commit that referenced this pull request Jul 13, 2024
Source paths have disappeared since #21, this PR adds them back.
@loichyan loichyan mentioned this pull request Jul 14, 2024
loichyan added a commit that referenced this pull request Jul 14, 2024
### ✨ Overview

This release mainly addresses the high memory usage issue reported in #18: fixed a potential memory leak (#21) and implemented stream processing (#22).

Also, some UI changes were introduced in #21, as we switched the diagnostic reporter from [codespan_reporting](https://docs.rs/codespan-reporting/latest/codespan_reporting) to [miette](https://docs.rs/miette/latest/miette).

### 🚀 Features

- **(runtime)** Set exact file size limit
- **(runtime)** Add file limitation
- **(runtime)** Filter out binary files

### 🐛 Bug Fixes

- **(cli)** Report the source path of diagnostics (#23)
- **(cli)** Subtract with overflow

### 🚜 Refactor

- **(runtime)** Implement stream processing
- **(runtime)** Zero-copy diagnostics reporting
- Replace `codespan-reporting` with `miette`
- **(util)** Rename `tryb!` to `try!`

### 📚 Documentation

- **(readme)** Update badge URLs

### 🎨 Styling

- Format with prettier
- Make nightly rustfmt compatible with the stable rustfmt
- Format with nightly rustfmt

### ⚙️ Miscellaneous Tasks

- Generate UTC release date
- Report Cargo check results
- Rewrite
- Fix typos
- Fix typos
- Update author name
- Add checks (#17)

### 🛠️ Build

- **(nix)** Update flakes
- **(cargo)** Update dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: out of memory
1 participant