Skip to content

Conversation

amyreese
Copy link
Contributor

Description:

This switches linting, formatting, and pre-commit checks from using black and isort directly to using µfmt, which runs µsort and black as an atomic formatting step. This matches what torchvision uses (pytorch/vision#4384).

Covered files were formatted using ./tests/run_code_style.sh fmt and pre-commit run validated the results.

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

@github-actions github-actions bot added examples Examples module: contrib Contrib module module: distributed Distributed module module: engine Engine module module: handlers Core Handlers module module: metrics Metrics module module: utils Utils module labels Feb 12, 2022
Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

@jreese thanks for the PR ! Yes, ufmt works well in torchvision and maintainers are rather happy with it.
I left a comment and let me see what other maintainers think about the change as code formatting could be rather opinionated :)

@amyreese
Copy link
Contributor Author

Rebased onto latest and unified on using usort diff.

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

Thanks @jreese !

@vfdev-5 vfdev-5 merged commit 4afaf9e into pytorch:master Feb 14, 2022
@amyreese amyreese deleted the usort branch February 14, 2022 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples Examples module: contrib Contrib module module: distributed Distributed module module: engine Engine module module: handlers Core Handlers module module: metrics Metrics module module: utils Utils module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants