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

Autoformat ApplyTypeAnnotationsVisitor #642

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

stroxler
Copy link
Contributor

@stroxler stroxler commented Feb 9, 2022

Summary

I find it difficult sometimes to read method and function signatures
when there are multiple arguments with type annotations - left-aligning
the arguments makes it much easier for me to skim and see, using mostly
my automatic visual resoning,

  • the argument names
  • the argument types
  • the return type

Without this, I feel like I'm trying to run a parser in my head, which
is not as fast and distracts me from code-skimming.

This change was generated using thte new AddTrailingCommas codemod
(see #643) via the command

python -m libcst.tool codemod add_trailing_commas.AddTrailingCommas ./libcst/codemod/visitors/_apply_type_annotations.py

Test Plan

Wait for CI - this is pure formatting, a format-only change should be very safe

I find it difficult sometimes to read method and function signatures
when there are multiple arguments with type annotations - left-aligning
the arguments makes it much easier for me to skim and see, using mostly
my automatic visual resoning,
- the argument names
- the argument types
- the return type

Without this, I feel like I'm trying to run a parser in my head, which
is not as fast and distracts me from code-skimming.

This change was generated using thte new AddTrailingCommas codemod
(which I'll put in a separate PR) via the command
```
python -m libcst.tool codemod add_trailing_commas.AddTrailingCommas ./libcst/codemod/visitors/_apply_type_annotations.py
```

Wait for CI - this is pure formatting, it should be very safe
@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 Feb 9, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #642 (f0869e5) into main (fb56fa6) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #642   +/-   ##
=======================================
  Coverage   94.79%   94.79%           
=======================================
  Files         245      245           
  Lines       25289    25289           
=======================================
  Hits        23973    23973           
  Misses       1316     1316           
Impacted Files Coverage Δ
libcst/codemod/visitors/_apply_type_annotations.py 95.18% <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 fb56fa6...f0869e5. Read the comment docs.

@stroxler stroxler merged commit 1aa40f7 into Instagram:main Feb 10, 2022
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.

3 participants