Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

feat: add delete-files flag #632

Merged
merged 9 commits into from
Jan 9, 2022
Merged

Conversation

incendial
Copy link
Member

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[ ] Bug fix
[ ] New rule
[ ] Changes an existing rule
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[X] Other, please explain: add a new flag to automatically delete unused files

@incendial incendial added this to the 4.9.0 milestone Jan 7, 2022
@incendial incendial self-assigned this Jan 7, 2022
@github-actions
Copy link

github-actions bot commented Jan 7, 2022

Dart Code Metrics analyze report of dart_code_metrics. ✅

Summary

  • Scanned folders: bin, example, lib, test

  • Total scanned files: 357

  • Total lines of source code: 6368

  • Total classes: 240

  • Average Cyclomatic Number per line of code: 0.35 / 1

  • Average Source Lines of Code per method: 6

  • Total tech debt: 1034.0 hours

  • Found issues: 6 ⚠

@codecov
Copy link

codecov bot commented Jan 7, 2022

Codecov Report

Merging #632 (8cf2b18) into master (09038f6) will decrease coverage by 0.11%.
The diff coverage is 69.69%.

❗ Current head 8cf2b18 differs from pull request most recent head 8562d56. Consider uploading reports for the commit 8562d56 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #632      +/-   ##
==========================================
- Coverage   86.15%   86.04%   -0.12%     
==========================================
  Files         234      235       +1     
  Lines        5013     5029      +16     
==========================================
+ Hits         4319     4327       +8     
- Misses        694      702       +8     
Impacted Files Coverage Δ
lib/src/analyzers/lint_analyzer/lint_analyzer.dart 93.75% <0.00%> (ø)
..._list/code_climate/lint_code_climate_reporter.dart 100.00% <ø> (ø)
.../reporters_list/console/lint_console_reporter.dart 100.00% <ø> (ø)
...rs/reporters_list/github/lint_github_reporter.dart 100.00% <ø> (ø)
...orters/reporters_list/html/lint_html_reporter.dart 0.31% <ø> (ø)
...orters/reporters_list/json/lint_json_reporter.dart 100.00% <ø> (ø)
...reporters_list/json/unused_l10n_json_reporter.dart 100.00% <ø> (ø)
...ib/src/reporters/models/code_climate_reporter.dart 100.00% <ø> (ø)
lib/src/reporters/models/console_reporter.dart 100.00% <ø> (ø)
lib/src/reporters/models/github_reporter.dart 100.00% <ø> (ø)
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 09038f6...8562d56. Read the comment docs.

output
..writeln('')
..writeln(
'${alarmPen('✖')} total unused files - ${alarmPen(sortedRecords.length)}',
'${alarmPen('✖')} total unused files - ${alarmPen(sortedRecords.length)}$removeFilesSuffix',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@incendial if we remove all unused files, why we in alarm state? I think this is good or info state, our repo not contains unused files.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -95,6 +96,14 @@ class UnusedFilesAnalyzer {
}).toSet();
}

Future<void> deleteAllUnusedFiles(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@incendial why this is async function? I see only sync methods.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@github-actions
Copy link

github-actions bot commented Jan 9, 2022

Dart Code Metrics unused files report of dart_code_metrics. ✅

Summary

  • Scanned package folders: bin, example, lib
  • No unused files found! ✅

@dkrutskikh dkrutskikh merged commit 0de44b7 into master Jan 9, 2022
@dkrutskikh dkrutskikh deleted the remove-unused-files-option branch January 9, 2022 20:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants