Turns out that the *name* of the first argument to your check function matters, and must be 'logical_line' in this case. And fix the prefix used in the error string. Output now looks like: neutron_lbaas/tests/base.py:19:1: N530 direct neutron imports not allowed from neutron.db import servicetype_db as st_db Change-Id: Ibdcf8ddc2ad832e031e3212392ad30364ceb3538