Skip to content

Formatting: Use 4-space indentation #1

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

Merged

Conversation

tony
Copy link
Contributor

@tony tony commented Jul 6, 2020

Fixes #7

(assuming formatting the codebase with black is okay)

This is the style formatting currently used in #6. If this is merged (or another contributor formats with black) I will rebase #6, so the code changes will be easier to digest.

Formatting

PEP 8 and 257, fixes indentation to 4 spaces.

https://www.python.org/dev/peps/pep-0008/#indentation

How to recreate:

pip install -U black
black sample-code setup.py tests sample-code qencode --skip-string-normalization

Black's formatting style is basically just PEP8: https://black.readthedocs.io/en/stable/the_black_code_style.html

String normalization

Black will change single quotes to double quotes by default.

I turned it off to just keep the changes to structural formatting in this PR. I'm happy to revise the PR if it's preferred to have strings formatted as well.

Remove skip-string-normalization from pyproject.toml and the above example command and rerun the formatter. All strings will now be consistently using double quotes.

tony added 2 commits December 6, 2021 08:29
To enable string normalization, remove this file/toggle the option and
rerun black. Without string normalization the formatter is purely
structural, single quotes will not be changed to double quotes.
@tony tony force-pushed the tn-black-formatting branch from 6a653a0 to 4353452 Compare December 6, 2021 14:30
@tony
Copy link
Contributor Author

tony commented Dec 6, 2021

@qencode-dev @VladimirParkhomenko

Rebased! As a start, how about we merge this? That will mean there's less conflicts in other PRs

What do you think?

@VladimirParkhomenko VladimirParkhomenko merged commit c46abab into Qencode-Corp:master Dec 6, 2021
@tony
Copy link
Contributor Author

tony commented Dec 6, 2021

@VladimirParkhomenko Thank you!

I will give #6 a fresh look ASAP. The rebase needed is non-trivial so it may be a weekend thing!

@tony tony deleted the tn-black-formatting branch December 6, 2021 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PEP8 code styling
2 participants