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

Run formatters based on the selected style #145

Merged
merged 2 commits into from
Aug 10, 2022
Merged

Run formatters based on the selected style #145

merged 2 commits into from
Aug 10, 2022

Conversation

DanielNoord
Copy link
Owner

No description provided.

@DanielNoord DanielNoord added the enhancement New feature or request label Aug 10, 2022
@github-actions
Copy link

According to the primer, this change has no effect on the checked open source code. 🤖🎉

@DanielNoord DanielNoord enabled auto-merge (rebase) August 10, 2022 10:49
@codecov
Copy link

codecov bot commented Aug 10, 2022

Codecov Report

Merging #145 (e4651c0) into main (7078101) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #145   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        20    +1     
  Lines          481       490    +9     
=========================================
+ Hits           481       490    +9     
Impacted Files Coverage Δ
...tringformatter/_configuration/formatter_options.py 100.00% <ø> (ø)
...cstringformatter/_formatting/formatters_default.py 100.00% <ø> (ø)
pydocstringformatter/_formatting/__init__.py 100.00% <100.00%> (ø)
pydocstringformatter/_formatting/base.py 100.00% <100.00%> (ø)
...ocstringformatter/_formatting/formatters_pep257.py 100.00% <100.00%> (ø)
pydocstringformatter/run.py 100.00% <100.00%> (ø)

@DanielNoord DanielNoord merged commit edd53a0 into main Aug 10, 2022
@DanielNoord DanielNoord deleted the style branch August 10, 2022 10:52
@DWesl
Copy link
Contributor

DWesl commented Aug 10, 2022

With this framing, you could probably set the default for --style to ["default"] and then append "pep257" if len(self.namespace.styles) <= 1

@DanielNoord
Copy link
Owner Author

Yeah I thought about that. However, if users did --style=pep257 default would be missing so they would need to do --style=pep257,default, which doesn't seem right.
Adding default to style would also work, but this if check accomplishes the same and might be clearer? I don't know honestly 😄

@DWesl
Copy link
Contributor

DWesl commented Aug 10, 2022

Depends on how the parser treats default values with action="append". I'd have to look into that to be sure.

@DanielNoord
Copy link
Owner Author

Yeah it just appends to the default. So you could end up with ["default", "pep257", "default"]. That's not necessarily any issue I guess.

@DWesl
Copy link
Contributor

DWesl commented Aug 10, 2022

Yeah it just appends to the default. So you could end up with ["default", "pep257", "default"]. That's not necessarily any issue I guess.

Since we're treating it as a set, not really. If that bothers you, we could change the action to change the value to a set or frozenset when it's done parsing the command line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants