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

Clean up Codacy outputs: accept single-character variables #255

Open
ajjackson opened this issue Nov 15, 2022 · 1 comment
Open

Clean up Codacy outputs: accept single-character variables #255

ajjackson opened this issue Nov 15, 2022 · 1 comment

Comments

@ajjackson
Copy link
Collaborator

A common warning in our Codacy outputs is that one-character variable names don't correspond to the expected "snake-case" conventions. It seems to be using Pylint which prefers variable names of at least three characters. But I really don't see much wrong with the way that we use short variable names; they are always given a narrow scope and conventional meaning, e.g.

  • fd for file descriptor in file opening context
  • i for integer iterator
  • x for function argument in a lambda or list comprehension

A suggested way of tolerating this while still catching some bad short names is to whitelist our favourites, which can be done in the Pylint config: https://stackoverflow.com/questions/21833872/why-does-pylint-object-to-single-character-variable-names

But I don't know where this should live or how it would interact with the Codacy framework.

@ajjackson ajjackson changed the title Clean up Codacy outputs Clean up Codacy outputs: accept single-character variables Nov 15, 2022
@rebeccafair
Copy link
Member

The Codacy site seems to suggest if we add a Pylint configuration file to the repository root, it will just work. I worry about having too much clutter in Euphonic's root dir but that would be a different issue.

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

No branches or pull requests

2 participants