~/talk

Custom Source Code Checks

Talkat PyCon Israel 2017 · 2017-06-11..06-13· [developer-experience, testing]
links:none on file
slides:none on file

A custom flake8 plugin is implemented that parses files with Python’s ast module and flags any public function or method that uses positional or args instead of keyword-only parameters, handling Python 2 and 3 forms and ignoring a single leading self/cls in methods. The project (foobar + foobar_flakes) registers via setuptools entry points, runs under tox and returns flake8-style (line, column, message) failures. Key pieces: flake8 plugin, AST-based checks, tox + setuptools entry point*.

AI-written summary · about

  1. 0:00Introduction to custom checks
  2. 1:23Why automate source checks
  3. 2:48Custom checks vs standard tools
  4. 6:41How Python processes code
  5. 8:27Working with AST in Python
  6. 10:12Finding function definitions
  7. 13:26Integrating with flake8
  8. 17:19Understanding function arguments
  9. 20:31Enforcing keyword-only args
  10. 23:23Customizing checks per project
  11. 24:49Running and fixing checks
  12. 25:10Setting up the environment
  13. 26:58Advantages of AST-based checks
  14. 27:42Q&A and resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.