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

Black trailing comma config #830

Merged

Conversation

szmazurek
Copy link
Collaborator

Fixes #825

Proposed Changes

  • added flag in .toml file to configure black NOT to split the line on every trailing comma

Checklist

  • CONTRIBUTING guide has been followed.
  • PR is based on the current GaNDLF master .
  • Non-breaking change (does not break existing functionality): provide as many details as possible for any breaking change.
  • Function/class source code documentation added/updated (ensure typing is used to provide type hints, including and not limited to using Optional if a variable has a pre-defined value).
  • Code has been blacked for style consistency and linting.
  • If applicable, version information has been updated in GANDLF/version.py.
  • If adding a git submodule, add to list of exceptions for black styling in pyproject.toml file.
  • Usage documentation has been updated, if appropriate.
  • Tests added or modified to cover the changes; if coverage is reduced, please give explanation.
  • If customized dependency installation is required (i.e., a separate pip install step is needed for PR to be functional), please ensure it is reflected in all the files that control the CI, namely: python-test.yml, and all docker files [1,2,3].

@szmazurek szmazurek self-assigned this Mar 21, 2024
Copy link
Contributor

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.04%. Comparing base (e1d359d) to head (702194a).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #830   +/-   ##
=======================================
  Coverage   95.04%   95.04%           
=======================================
  Files         120      120           
  Lines        8268     8268           
=======================================
  Hits         7858     7858           
  Misses        410      410           
Flag Coverage Δ
unittests 95.04% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@sarthakpati sarthakpati left a comment

Choose a reason for hiding this comment

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

LGTM

@sarthakpati sarthakpati merged commit 4c0a319 into mlcommons:master Mar 22, 2024
21 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 22, 2024
@VukW
Copy link
Contributor

VukW commented Mar 23, 2024

Folks. are you sure it works as expected? It seems skip_magic_trailing_comma = true is breaking extend-exclude rule now and is not applied properly

@VukW
Copy link
Contributor

VukW commented Mar 23, 2024

Also, right now black covers only gandlf_* scripts. Despite of that, 95% of code base is aligned with black (if you turn off include = 'gandlf_*' and run check you would see just 11 files that should be reformatted).
However, this setting requires to reformat around ~+30 new files. What do you think if we add these updates to this PR also, in order not to accumulate technical debt?

@sarthakpati
Copy link
Collaborator

Hey @VukW can you put in a PR fixing the issues you are mentioning? I probably missed this because of my default options in vs code.

@szmazurek
Copy link
Collaborator Author

@VukW Hey, thanks, that's actually great remark, did not see that. Thanks! I am joining @sarthakpati request, if you cannot then just ping me, I will try to resolve it.

@VukW
Copy link
Contributor

VukW commented Mar 23, 2024

No worries, fabs, I'd make a PR with fix in a few hours

@VukW
Copy link
Contributor

VukW commented Mar 23, 2024

#832

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Black configuration in pyproject.toml
3 participants