Search code examples
githubpylintcodacypylintrc

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


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"?


Solution

  • 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