I'm running Pylint 1.7.2 with Python 3.6.2. Pylint is showing the following error:
Invalid function name "create_maximization_option_dataframe" (invalid-name)
I define a function like so in my code:
def create_maximization_option_dataframe(file_name):
The PEP8 style guide basically just says:
Function names should be lowercase, with words separated by underscores as necessary to improve readability.
As far as I'm aware I'm following all the formatting rules for a function name. Does Pylint have some built-in maximum function name length rule that I'm not aware of? I can ignore the Pylint error easily enough but I want to understand why this is happening first.
Make a config file by doing pylint pylint --generate-rcfile
. The scope of that depends where you put it. Quoting https://docs.pylint.org/en/1.6.0/run.html
If the current working directory is in a Python module, Pylint searches up the hierarchy of Python modules until it finds a pylintrc file. This allows you to specify coding standards on a module-by-module basis. Of course, a directory is judged to be a Python module if it contains an init.py file.
The file named by environment variable PYLINTRC
if you have a home
directory which isn’t /root: .pylintrc in your home directory
.config/pylintrc in your home directory
/etc/pylintrc
Sounds like you need option 5 or 6.
In the pylintrc, find this bit
# Regular expression matching correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$
Change that 30 near the end to 40 or so.
According to PyLint documentation, a function name must have from 2 to 30 characters. Yours has 36.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With