test suite does not work with flake8 3.x
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
hacking |
New
|
Undecided
|
Unassigned |
Bug Description
hacking's test suite does not work with flake8 3.x. It tries to run checks by getting a styleguide from flake8 and using its options to initialize a report and a checker from pep8 (pycodestyle). flake8 3.x just doesn't really work for that approach any more; even if you adjust to use its 'legacy api', its imitation of a styleguide instance doesn't actually have sufficient data to convince a pep8 checker to run the right checks.
Fortunately, there's a different approach we can use which is actually simpler and works for both 2.x and 3.x; we just use the styleguide directly to run the tests. 3.x's 'legacy API' *does* work for this, as that's what it's explicitly intended to work for, per http://
The test_local.
I'm gonna stick my patch here for now as I'm just too tired to jump through the zillions of hoops required to submit it 'properly'. I work for Red Hat, so it may be the case that I don't have to / am not allowed to join and sign the CLA as an individual. I'll see what RH's OpenStack people advise me to do later, I guess. For now, here's what I got.
oh, in case you're wondering why the temporary files are necessary - the flake8 3.x API does not provide any ability to run tests on an iterable of lines. It only gives you `check_files` (which requires an iterable of file names) and `input_file` (which has a 'lines' arg, but completely ignores it - it really just takes the filename and feeds it to `check_files`).