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

Python indentation mismatch for the pylintrc file and what described in python style guide #871

Open
mhaoli opened this issue Dec 26, 2024 · 1 comment
Assignees
Labels
lang:python The Python language

Comments

@mhaoli
Copy link

mhaoli commented Dec 26, 2024

The external python style guide says indentation should be 4 spaces:

3.4 Indentation
Indent your code blocks with 4 spaces.

The style guide also provides an pylintrc file:

2.1 Lint
Run pylint over your code using this [pylintrc](https://google.github.io/styleguide/pylintrc).

While in the pylintrc file, following configuration sets indentation to 2 spaces:

# String used as indentation unit.  The internal Google style guide mandates 2
# spaces.  Google's externaly-published style guide says 4, consistent with
# PEP 8.  Here, we use 2 spaces, for conformity with many open-sourced Google
# projects (like TensorFlow).
indent-string='  '

So which indentation should we use?

@vapier vapier added the lang:python The Python language label Jan 2, 2025
@vapier
Copy link
Member

vapier commented Jan 2, 2025

thanks for highlighting this. it should be 4 spaces in the pylintrc.

although it's becoming moot with pylint slowly dropping support for formatting related checks and pushing people to use black.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang:python The Python language
Projects
None yet
Development

No branches or pull requests

3 participants