On 10/18/19 7:17 AM, Alexander Todorov wrote:
На 18.10.19 г. в 15:12 ч., Ian Stapleton Cordasco написа:
Hi Mats,
I can't speak for pylint, but Flake8 allows you to specify --builtins
when checking things (which we use to alter PyFlakes' understanding of
what is a built-in). Based on what you described, I think that would
allow you to do something with Flake8 locally or to steal some of the
Flake8 code to make your own `scons --check`.
Pylint (or rather astroid) has the concept of transformation plugins
which can teach the tool about the underlying API. Such approach is used
by pylint-django:
https://github.com/PyCQA/pylint-django/tree/master/pylint_django/transforms
pylint-django also uses so called augmentations, mostly to ignore some
checkers depending on context:
https://github.com/PyCQA/pylint-django/blob/master/pylint_django/augmentations
I don't know about other tools but it is relatively easy to figure out
how to create plugins for pylint. I can send you more examples about the
augmentations stuff but to my knowledge it is very sparsely documented.
If you decide to go this way the biggest unknown would be how much
augmentation you will have to do to teach the linter about scons API.
Could be relatively straight forward, could turn out to be PITA.
--
Alex
ah, this looks interesting. will take a while to absorb (pointer to
other examples would indeed be welcome), but I do kind of see the concept:
suppress_message(linter, TypeChecker.visit_attribute, 'no-member',
is_manager_attribute)
thanks!
_______________________________________________
code-quality mailing list -- code-quality@python.org
To unsubscribe send an email to code-quality-le...@python.org
https://mail.python.org/mailman3/lists/code-quality.python.org/