Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

tidy global variables #1865

Open
reidpr opened this issue Mar 20, 2024 · 0 comments
Open

tidy global variables #1865

reidpr opened this issue Mar 20, 2024 · 0 comments

Comments

@reidpr
Copy link
Collaborator

reidpr commented Mar 20, 2024

Split from #1860. Pylint:

  • C0103 invalid-name
  • W0603 global-statement

# Absolute path of Git binary we’re using.
git = None
# Default path within image to metadata pickle.
PICKLE_PATH = fs.Path("ch/git.pickle")

Python does not have constants, and the convention Pylint wants is that module globals are treated as constants and use UPPER_CASE naming style. I believe what we’re doing is:

  1. Module globals set during import are treated as constants and use UPPER_CASE.

  2. Module globals set once, then treated as constant; we use snake_case for these.

  3. True global variables, snake_case.

Groups 1 and 2 should be set once only and constant after that. I don't know how many 3 we have.

Pylint also just doesn’t want us to use global at all which honestly makes sense.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant