Analyzing Python Code from Python - AST Parsing and Custom Lint Checks

Analyzing Python Code from Python - AST Parsing and  Custom Lint Checks
Linting is the process of checking your code for various stylistic and structural things that you (subjectively) want to avoid.

Linting is the process of checking your code for various stylistic and structural things that you (subjectively) want to avoid. Flake8 is a popular linter that has a lot of good default checks, but what if you want to make your own checks? In that case, you can write your own custom Flake8 plugin, which is what we do in this video! We will use the ast module to programmatically parse and examine the structure of our Python code in order to actually implement the checks.

CHAPTERS

0:00 Intro
0:18 What’s a linter?
0:49 The goal
1:12 Don’t use regex
1:58 Abstract Syntax Trees
3:31 NodeVisitor
4:42 Plugin skeleton
6:36 Our first error
7:03 No local import check
8:19 Refactoring checks
9:05 Adding options
10:13 Homework
10:51 Package your plugin

Suggest:

Learn Python in 12 Hours | Python Tutorial For Beginners

Complete Python Tutorial for Beginners (2019)

Python Tutorials for Beginners - Learn Python Online

Python Programming Tutorial | Full Python Course for Beginners 2019

Python Tutorial for Beginners [Full Course] 2019

Learn Python 3 Fundamentals From Scratch