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

feature: auto fix problems #672

Merged
merged 8 commits into from
Sep 29, 2024
Merged

Conversation

lucas-it
Copy link
Contributor

This PR adds the possibility of using the --fix argument to automatically fix problems.

Currently, I've only implemented the auto fix of indentation and trailing spaces. The goal was just to add the global logic.

@Nyaran
Copy link
Owner

Nyaran commented Sep 27, 2024

Hi,

sounds awesome, I will try to review it as soon as possible.

Meanwhile, try to add some tests

@lucas-it
Copy link
Contributor Author

Hi,

sounds awesome, I will try to review it as soon as possible.

Meanwhile, try to add some tests

Hello,
Thank you for your responsiveness.

I totally forgot to check the tests, my bad.
I've refactored all the fixLine methods and added a few tests.

Don't hesitate to let me know if you need any adjustments. It's possible that I didn't quite understand how the code should be organised.

Copy link

codecov bot commented Sep 29, 2024

Codecov Report

Attention: Patch coverage is 92.06349% with 5 lines in your changes missing coverage. Please review.

Project coverage is 99.30%. Comparing base (f42a3f5) to head (25e6d3c).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
src/rules/indentation.ts 84.21% 3 Missing ⚠️
src/rules/no-trailing-spaces.ts 86.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #672      +/-   ##
==========================================
- Coverage   99.47%   99.30%   -0.18%     
==========================================
  Files          44       45       +1     
  Lines        2672     2715      +43     
  Branches      463      465       +2     
==========================================
+ Hits         2658     2696      +38     
- Misses         13       18       +5     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Nyaran Nyaran added the enhancement New feature or request label Sep 29, 2024
@Nyaran Nyaran self-assigned this Sep 29, 2024
@Nyaran Nyaran linked an issue Sep 29, 2024 that may be closed by this pull request
@Nyaran
Copy link
Owner

Nyaran commented Sep 29, 2024

LGTM, thanks!

@Nyaran Nyaran merged commit 27c1292 into Nyaran:main Sep 29, 2024
11 of 13 checks passed
@lucas-it lucas-it deleted the feature/auto-fix-problems branch September 29, 2024 13:00
@Nyaran
Copy link
Owner

Nyaran commented Sep 29, 2024

Published on v2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

Implement --fix
2 participants