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

Style: Clear Naming Convention for Variables #563

Open
jdsika opened this issue Mar 4, 2022 · 3 comments
Open

Style: Clear Naming Convention for Variables #563

jdsika opened this issue Mar 4, 2022 · 3 comments
Assignees
Labels
help wanted Extra attention is needed Quality From user journey improvements to code cleanups.

Comments

@jdsika
Copy link
Contributor

jdsika commented Mar 4, 2022

Some auto formatting e.g. in batch_payer.py is very strange.

            number_future_payable_cycles = (
                int(
                    payment_address_balance
                    / (estimated_amount_to_pay * PAYMENT_ACCOUNT_SAFETY_MARGIN)
                )
                - 1
            )
@jdsika jdsika added the Quality From user journey improvements to code cleanups. label Mar 4, 2022
@jdsika jdsika added this to the v10.0 (Granada) milestone Mar 4, 2022
@vkresch
Copy link
Contributor

vkresch commented Mar 29, 2022

This is due to the default line length for black – 88 characters per line.
To increase the line length, we could use the --line-length flag.

$ black --line-length 92 .

Or we could make the variable names smaller but still keep it explicit e.g.:
payment_address_balance -> payment_balance

We could also think about how to reduce the indentation on the left side etc.

@jdsika
Copy link
Contributor Author

jdsika commented Mar 29, 2022

ok, I think we leave this open to remind us to rename variables to a certain style in the future. I think modifying black regarding --line-length is not the trick. A clear naming convention is maybe better.

@jdsika jdsika added the help wanted Extra attention is needed label Mar 29, 2022
@jdsika jdsika removed this from the v10.0 (Hangzhou) milestone Mar 29, 2022
@jdsika jdsika changed the title Style: Tweak black formatting Style: Clear Naming Convention for Variables Mar 29, 2022
@ericlavoie
Copy link
Contributor

This is due to the default line length for black – 88 characters per line. To increase the line length, we could use the --line-length flag.

$ black --line-length 92 .

Or we could make the variable names smaller but still keep it explicit e.g.: payment_address_balance -> payment_balance

We could also think about how to reduce the indentation on the left side etc.

The 88 is a limitation to be compatible with vt100 terminal. I prefer having it set at 99/100 88 is too short imo. Just my 0.02$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed Quality From user journey improvements to code cleanups.
Projects
None yet
Development

No branches or pull requests

3 participants