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

Reformat to use spaces instead of tabs #745

Closed
wants to merge 4 commits into from

Conversation

ezzieyguywuf
Copy link
Contributor

The following command was used to reformat:

autopep8 --in-place --select=E101,E11,E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E133,E20,E211,E22,E224,E224,E226,E227,E228,E231,E241,E242,E251,E252,E26,E265,E266,E27,E301,E302,E303,E304,E305,E306,W291,W293,W391 -r .

The test suite was ran afterwards and everything seems to pass.

Signed-off-by: Wolfgang E. Sanyer WolfgangESanyer@gmail.com

@zmedico
Copy link
Member

zmedico commented Sep 17, 2021

We should document how to preserve blame and probably reformat with black while we're here.

@ezzieyguywuf
Copy link
Contributor Author

We should document how to preserve blame and probably reformat with black while we're here.

Should this be documented in the commit message? Or the README? Elsewhere?

@zmedico
Copy link
Member

zmedico commented Sep 18, 2021

We should document how to preserve blame and probably reformat with black while we're here.

Should this be documented in the commit message? Or the README? Elsewhere?

A git configuration section in the README would be nice. Unfortunately, there's no support in github yet.

@ezzieyguywuf
Copy link
Contributor Author

Ok, i can update the README no prob.

@zmedico
Copy link
Member

zmedico commented Sep 19, 2021

Ideally, we'd have some kind of commit hook to automate normalization of formatting. I suggested black, but an autopep8 commit hook could also suffice.

@zmedico
Copy link
Member

zmedico commented Sep 19, 2021

We need PRs to fail if there are any formatting changes needed, like for pylint.

@ezzieyguywuf
Copy link
Contributor Author

So add a GitHub action that checks this?

The following command was used to reformat:

autopep8 --in-place --select=E101,E11,E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E133,E20,E211,E22,E224,E224,E226,E227,E228,E231,E241,E242,E251,E252,E26,E265,E266,E27,E301,E302,E303,E304,E305,E306,W291,W293,W391 -r .

black was run as `black .`, using the default configurations

Signed-off-by: Wolfgang E. Sanyer <WolfgangESanyer@gmail.com>
@zmedico
Copy link
Member

zmedico commented Sep 20, 2021

So add a GitHub action that checks this?

Yes, please do. Thanks!

@ezzieyguywuf
Copy link
Contributor Author

So add a GitHub action that checks this?

Yes, please do. Thanks!

Done. Here's what's included in this PR now:

  1. Changed tabs to spaces
  2. Ran black against the entire code base
  3. Added a github action to check that black was run
  4. Changed README to README.md
  5. Added information to README for
    a. how to ignore rev 1bb64ff when using git blame
    b. how to integrate black into IDE
    c. how to integrate black into git hook

Signed-off-by: Wolfgang E. Sanyer <WolfgangESanyer@gmail.com>
Signed-off-by: Wolfgang E. Sanyer <WolfgangESanyer@gmail.com>
Signed-off-by: Wolfgang E. Sanyer <WolfgangESanyer@gmail.com>
Copy link
Member

@zmedico zmedico left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!


Contributions are always welcome! We've started using
[black](https://pypi.org/project/black/) to format the code base. Please make
sure you run it against any PR's prior to submitting (otherwise we'll probably
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
sure you run it against any PR's prior to submitting (otherwise we'll probably
sure you run it against any PRs prior to submitting (otherwise we'll probably

Contributing
============

Contributions are always welcome! We've started using
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Contributions are always welcome! We've started using
Contributions are always welcome! We use

black --check --diff .
```

To ignore commit 1bb64ff452 - which is a massive commit that simply formatted
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
To ignore commit 1bb64ff452 - which is a massive commit that simply formatted
To ignore exclusively reformatting commits (listed within ```.gitignorerevs```), you can do the following:

```

To ignore commit 1bb64ff452 - which is a massive commit that simply formatted
the code base using black - you can do the following:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
the code base using black - you can do the following:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants