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

Add fix command #152

Merged
merged 8 commits into from
Nov 7, 2024
Merged

Add fix command #152

merged 8 commits into from
Nov 7, 2024

Conversation

byshy
Copy link
Contributor

@byshy byshy commented Nov 4, 2024

Like the analyze command, I added a fix command that utilizes the replacement defined inside each rule to automatically replace the fixes

You can run the command on the example/lib and it will identify the 3 issues it has in the main.dart file, and fix only 1 (which has the replacement defined)

dart run dart_code_linter:metrics fix example/lib

@santitigaga
Copy link
Contributor

@byshy please pull changes

@byshy
Copy link
Contributor Author

byshy commented Nov 6, 2024

Done

@byshy
Copy link
Contributor Author

byshy commented Nov 6, 2024

As a quick note, before publishing the changes to pub get, we should run the dart formatter on the changed files (in this PR and the 3 before) since I have custom rules on my IDE to set the length of the dart line to 130, it should be 80, so we should run that then publish

lib/src/cli/models/parsed_arguments.dart Show resolved Hide resolved
lib/src/cli/commands/fix_lints_command.dart Outdated Show resolved Hide resolved
lib/src/cli/commands/fix_lints_command.dart Outdated Show resolved Hide resolved
lib/src/analyzers/lint_analyzer/lint_analyzer.dart Outdated Show resolved Hide resolved
@santitigaga santitigaga linked an issue Nov 6, 2024 that may be closed by this pull request
- Add jsonReportPath to the fix command
- Add unit test to the fix command
@byshy
Copy link
Contributor Author

byshy commented Nov 7, 2024

Notes handled, I'm available for new notes if any 🙏

@santitigaga santitigaga merged commit 42bbf82 into bancolombia:trunk Nov 7, 2024
1 check passed
@byshy
Copy link
Contributor Author

byshy commented Nov 7, 2024

Amazing!!
Can we connect on linkedIn @santitigaga ?

@santitigaga
Copy link
Contributor

santitigaga commented Nov 7, 2024

@byshy
Copy link
Contributor Author

byshy commented Nov 7, 2024

Invitation sent

@byshy byshy deleted the fix_command branch November 8, 2024 15:50
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.

The package doesn't support the "fix" command.
2 participants