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

Gathering exports in augmented assignment statements #426

Merged
merged 1 commit into from
Dec 16, 2020

Conversation

Kronuz
Copy link
Contributor

@Kronuz Kronuz commented Dec 3, 2020

Summary

Add support for gathering exports in __all__ augmented assignments, such as:

import os
__all__ = []
__all__ += ["os"]

Test Plan

Run existing tests

@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 Dec 3, 2020
@Kronuz Kronuz force-pushed the Kronuz-augmented-exports branch from e2a313a to 5ad75fe Compare December 3, 2020 01:24
@Kronuz Kronuz force-pushed the Kronuz-augmented-exports branch 2 times, most recently from 895c80b to e4864d5 Compare December 7, 2020 17:20
@codecov-io
Copy link

Codecov Report

Merging #426 (e4864d5) into master (8eee3cc) will decrease coverage by 0.00%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #426      +/-   ##
==========================================
- Coverage   94.33%   94.33%   -0.01%     
==========================================
  Files         232      232              
  Lines       22586    22598      +12     
==========================================
+ Hits        21307    21318      +11     
- Misses       1279     1280       +1     
Impacted Files Coverage Δ
libcst/codemod/visitors/_gather_exports.py 96.34% <87.50%> (-0.96%) ⬇️
...bcst/codemod/visitors/tests/test_gather_exports.py 100.00% <100.00%> (ø)

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 8eee3cc...e4864d5. Read the comment docs.

@Kronuz Kronuz requested a review from jimmylai December 8, 2020 00:58
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.

LGTM, use a matcher can keep the code simpler.

libcst/codemod/visitors/_gather_exports.py Outdated Show resolved Hide resolved
@Kronuz Kronuz force-pushed the Kronuz-augmented-exports branch 2 times, most recently from f2c0c0a to 640a596 Compare December 16, 2020 01:13
@Kronuz Kronuz force-pushed the Kronuz-augmented-exports branch from 640a596 to 1622e89 Compare December 16, 2020 01:50
@Kronuz Kronuz merged commit 753a4f5 into master Dec 16, 2020
@Kronuz Kronuz deleted the Kronuz-augmented-exports branch December 16, 2020 02:17
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.

4 participants