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

Ambiguity in the documentation #3375

Closed
Lincoln-Chamberlin opened this issue Nov 5, 2022 · 5 comments
Closed

Ambiguity in the documentation #3375

Lincoln-Chamberlin opened this issue Nov 5, 2022 · 5 comments
Labels
good first issue Good for newcomers S: accepted The changes in this design / enhancement issue have been accepted and can be implemented T: documentation Improvements to the docs (e.g. new topic, correction, etc)

Comments

@Lincoln-Chamberlin
Copy link

Is this related to a problem? Please describe.

This is a suggestion to improve some ambiguity in the Pragmatism section of the documentation.
https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#ast-before-and-after-formatting

Current text (first paragraph of section 'AST before and after formatting')

When run with --safe, Black checks that the code before and after is semantically equivalent. This check is done by comparing the AST of the source with the AST of the target.

Describe the solution you'd like

I would like to see it specified that --safe is the default. The currently wording makes it sound like --safe is an available option that can be specified but is not enabled by default.

Additional context

I decided to submit this improvement suggestion after reading this, misunderstanding it, and looking through the customization documentation, only to find that what I want is already the default.

@Lincoln-Chamberlin Lincoln-Chamberlin added the T: documentation Improvements to the docs (e.g. new topic, correction, etc) label Nov 5, 2022
@JelleZijlstra
Copy link
Collaborator

Good point, PR welcome!

@Lincoln-Chamberlin
Copy link
Author

I would recommend a wording like

When run with --safe (the default), Black checks that the code before and after is semantically equivalent. This check is done by comparing the AST of the source with the AST of the target.

I am not currently interested in learning about the pull request prosses for black

@ichard26 ichard26 added good first issue Good for newcomers S: accepted The changes in this design / enhancement issue have been accepted and can be implemented labels Nov 6, 2022
@ichard26
Copy link
Collaborator

ichard26 commented Nov 6, 2022

No worries! This makes for an easy PR that's great for beginners. I won't say no to that :)

mcsitter added a commit to mcsitter/black that referenced this issue Nov 9, 2022
@aaossa
Copy link
Contributor

aaossa commented Nov 11, 2022

This seems to have been completed by #3378

@ichard26
Copy link
Collaborator

Yup! Thanks for noticing! I really did merge that PR mindlessly didn't I... whoops :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers S: accepted The changes in this design / enhancement issue have been accepted and can be implemented T: documentation Improvements to the docs (e.g. new topic, correction, etc)
Projects
None yet
Development

No branches or pull requests

4 participants