You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Define ``visit_[token]`` or ``leave_[token]`` methods to process respective tokens.
63
+
Module(
64
+
name='',
65
+
doc=None,
66
+
file='<?>',
67
+
path=['<?>'],
68
+
package=False,
69
+
pure_python=True,
70
+
future_imports=set(),
71
+
body=[Assign(
72
+
targets=[AssignName(name='test')],
73
+
value=Const(value='foobar'))])
74
+
75
+
- Or in a debugging session on any given AST node:
76
+
77
+
.. code-block:: python
78
+
79
+
print(node.repr_tree())
80
+
81
+
# For example:
82
+
node = astroid.parse('''test = "foobar"''')
83
+
print(node.repr_tree())
84
+
85
+
- Define ``visit_[token]`` or ``leave_[token]`` methods to process respective tokens, e.g. ``visit_module()``.
62
86
- All available token types: http://pylint.pycqa.org/projects/astroid/en/latest/api/astroid.nodes.html.
63
87
- Pylint searches for the variable ``msgs`` in a checker, make sure it is named exactly that.
64
-
- Pylint lends itself nicely for test driven development: add one or more test cases (preferably both valid and invalid cases), and then implement a checker to run the test cases successfully.
88
+
- Pylint lends itself nicely for test driven development: add one or more test cases (preferably both valid and invalid cases), and then implement a checker to run the test cases successfully.
65
89
- Some useful resources to learn about Pylint:
66
-
- `How to write Pylint plugins by Alexander Todorov - PiterPy 2018 <https://piterpy.com/system/attachments/files/000/001/519/original/how_to_write_pylint_plugins_PiterPy_2018.pdf>`_
- `How to write Pylint plugins by Alexander Todorov - PiterPy 2018 <https://piterpy.com/system/attachments/files/000/001/519/original/how_to_write_pylint_plugins_PiterPy_2018.pdf>`_
0 commit comments