Hi all, I was going through the *checkers/typecheck.py* for reference but could not understand it concretely. I am basically unable to find how to retrieve arguments from Astng Function node. I am using visit_function() inside a checker class to visit all function nodes but not able to get list of arguments(and varargs and kwargs too). Also, is there a function which returns <type function> if we pass Astng Function node to it? Thanks in advance! On Mon, Jun 29, 2015 at 11:46 PM, Claudiu Popa <pcmanticore@gmail.com> wrote:
On Mon, Jun 29, 2015 at 12:32 PM, Ahirnish Pareek <ahirnish@arista.com> wrote:
Hi all,
I want to add a customized check to my pylintrc file to check and report cases whenever I define a function in a python file like this:
def foo( var1, name1=value, *args ):
The problem that I want to deal with is that we should not have keyword arguments( name1 ) before positional arguments( *args ). Although the function can still be called by passing name1 as positional argument but there would be no way to not specify name1 but specify *args.
How can I add this check to pylintrc file?
Thanks in advance!
Hi,
If you already have the checker, you can add it in the load-plugins entry from the pylintrc file, as in `load-plugins=qualified plugin path`. We don't have this check builtin right now, but it's something that could be useful, so if you could send it upstream, that would be really awesome.
Thanks,
Claudiu
-- Regards, Ahirnish