import argparse
from argparse import ArgumentParser
parser = ArgumentParser(description="Test Massage")
flake8 in vim accurate error
test.py|4 col 1 warning| [invalid-name] Invalid constant name "parser"
import argparse
from argparse import ArgumentParser
parser = ArgumentParser(description="Test Massage")
flake8 in vim accurate error
test.py|4 col 1 warning| [invalid-name] Invalid constant name "parser"
I had the same error using Pylint
and I solved it moving the assignment in a function (make a dedicated function to parse the command line). I guess it treats the module level variables as constants, like Pylint also does, because it doesn't make much sense to declare them there and it's much easier to apply a simple rule than to really detect if it is a constant.