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

Fixit CLI #148

Merged
merged 17 commits into from
Oct 24, 2020
Merged

Fixit CLI #148

merged 17 commits into from
Oct 24, 2020

Conversation

acharles7
Copy link
Contributor

Summary

Installation:

$ pip install fixit

Usage:

$ fixit --help
$ fixit run_rules --help
$ fixit apply_fix --help
$ fixit insert_suppressions --help
$ fixit add_new_rule --help

This PR creates new CLI for fixit module

Please follow this sequence to review this PR:

1. setup.py
2. main.py
3. {run_rules.py, apply_fix.py, insert_suppressions.py, add_new_rule.py}

Note: To support backward compatibility, I have changed existing files run_rules.py, apply_fix.py etc. for this cli without affecting previous scripts workflow with a new architecture. Will remove redundant code once this CLI published and more robust.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 12, 2020
@codecov-io
Copy link

codecov-io commented Oct 12, 2020

Codecov Report

Merging #148 into master will increase coverage by 25.12%.
The diff coverage is 39.47%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #148       +/-   ##
===========================================
+ Coverage   59.48%   84.60%   +25.12%     
===========================================
  Files         272       85      -187     
  Lines       38943     3508    -35435     
===========================================
- Hits        23164     2968    -20196     
+ Misses      15779      540    -15239     
Impacted Files Coverage Δ
setup.py 100.00% <ø> (ø)
fixit/cli/add_new_rule.py 38.29% <35.71%> (+0.46%) ⬆️
fixit/cli/main.py 38.88% <38.88%> (ø)
fixit/cli/apply_fix.py 32.06% <40.00%> (+0.65%) ⬆️
fixit/cli/run_rules.py 41.89% <40.00%> (+0.35%) ⬆️
fixit/cli/insert_suppressions.py 38.73% <42.85%> (+0.50%) ⬆️
fixit/rules/use_assert_is_not_none.py 91.89% <0.00%> (-8.11%) ⬇️
fixit/rule_lint_engine.py 95.29% <0.00%> (ø)
fixit/common/tests/test_ignores.py 100.00% <0.00%> (ø)
fixit/tests/test_rule_lint_engine.py 100.00% <0.00%> (ø)
... and 195 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 3a61d8f...39d7f6c. Read the comment docs.

fixit/cli/add_new_rule.py Outdated Show resolved Hide resolved
fixit/cli/main.py Outdated Show resolved Hide resolved
fixit/cli/main.py Outdated Show resolved Hide resolved
@acharles7
Copy link
Contributor Author

@jimmylai Can you please look into the pyre error? To avoid those errors I have to put pyre-ignore everywhere. Do you know any workaround to avoid it?

@acharles7 acharles7 requested a review from jimmylai October 20, 2020 07:36
fixit/cli/run_rules.py Outdated Show resolved Hide resolved
fixit/cli/run_rules.py Outdated Show resolved Hide resolved
@acharles7 acharles7 requested a review from jimmylai October 20, 2020 15:56
@acharles7
Copy link
Contributor Author

@jimmylai Can you please look into the pyre error? To avoid those errors I have to put pyre-ignore everywhere. Do you know any workaround to avoid it?

any update?

Copy link
Contributor

@jimmylai jimmylai left a comment

Choose a reason for hiding this comment

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

Please follow the suggestion to fix the type error on all _add_arguments and register_subparser.

fixit/cli/add_new_rule.py Outdated Show resolved Hide resolved
fixit/cli/add_new_rule.py Outdated Show resolved Hide resolved
@acharles7 acharles7 requested a review from jimmylai October 23, 2020 05:35
Copy link
Contributor

@jimmylai jimmylai left a comment

Choose a reason for hiding this comment

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

Thanks for contributing.

Found one more thing can be improved.

fixit/cli/run_rules.py Outdated Show resolved Hide resolved
fixit/cli/run_rules.py Outdated Show resolved Hide resolved
@acharles7 acharles7 requested a review from jimmylai October 23, 2020 19:40
fixit/cli/add_new_rule.py Outdated Show resolved Hide resolved
fixit/cli/add_new_rule.py Outdated Show resolved Hide resolved
fixit/cli/main.py Outdated Show resolved Hide resolved
fixit/cli/main.py Outdated Show resolved Hide resolved
@jimmylai jimmylai merged commit 4637652 into Instagram:master Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fixit CLI
4 participants