Is it possible to get codacy to check usage of imported modules?

541 Views Asked by At

I have an ever-growing list of modules to ignore in my pylintrc:

ignored-modules=anytree,apsw,bs4,cachecontrol,dateutil,inflect,matplotlib,markdown,munch,MySQLdb,pytest,pytz,requests_oauthlib,rrule,seaborn,titlecase,untangle,googleapiclient

because otherwise codacy will fail my pull request.

Is there a way to have codacy know about these (pip) modules?

Failing that is there a way to say "ignore these on codacy checks but don't ignore them during local runs of pylint"?

1

There are 1 best solutions below

3
On BEST ANSWER

The fact that there is a .codacy-pylintrc file suggests it is possible to configure codacy-pylint to use a dedicate pylintrc file (with the -rcfile=.codacy-pylintrc option)

As opposed to a local run of pylint, which will look by default for a regular ~/.pylintrc file (where you don't have to ignore those modules).

As commented, that also means you can do the reverse:

  • make sure your local run of pylint uses a custom file (with the -rcfile=xxx option),
  • while codacy-pylint would use the default .pylintrc file