Euphonic is a Python package for efficient simulation of phonon bandstructures, density of states and inelastic neutron scattering intensities from force constants.
GNU General Public License v3.0
28
stars
11
forks
source link
Clean up Codacy outputs: accept single-character variables #255
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
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.
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 contexti
for integer iteratorx
for function argument in a lambda or list comprehensionA 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.