Commit graph

199 commits

Author SHA1 Message Date
Anthony Sottile
308a0bdb50 Be explicit about the bytes put into test files 2018-10-23 15:47:18 -07:00
Anthony Sottile
42590a68a5 Revert "Merge branch 'revert-63b91c95' into 'master'"
This reverts commit ba2fb9c53a, reversing
changes made to 63b91c95ea.
2018-10-23 15:06:49 -07:00
Anthony Sottile
fb1f257128 Revert "Merge branch 'match_newlines_py3' into 'master'"
This reverts merge request !253
2018-10-23 21:53:19 +00:00
Anthony Sottile
63b91c95ea Merge branch 'match_newlines_py3' into 'master'
Fix inconsistent newlines read from a file in python3

Closes #457

See merge request pycqa/flake8!253
2018-10-23 21:44:22 +00:00
Jintao Zhang
5188a146c2 Fix collections ABCs deprecation warning.
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
2018-10-23 11:52:48 +08:00
Anthony Sottile
a42bfdf6d2 Fix inconsistent newlines read from a file in python3 2018-10-22 17:10:18 -07:00
Ian Stapleton Cordasco
56b86ba9fe
Fix up test files for W504 2018-10-20 12:37:32 -05:00
Anthony Sottile
e73055432c Only skip a file if # flake8: noqa is on a line by itself 2018-07-01 08:40:26 -07:00
Ian Stapleton Cordasco
d6ab32112f
Fix issue with pep8-naming 2018-05-20 10:46:13 -05:00
Ville Skyttä
e8e35ea0ae Add some extend_ignores into decision engine test cases 2018-05-20 12:04:40 +02:00
Ville Skyttä
e520c2d936 Implement --extend-ignore
Refs #365
2018-05-16 08:50:26 +02:00
Ian Stapleton Cordasco
5221014947 Merge branch '405-nonexisting-files' into 'master'
Resolve "flake8 does not generate error when given a non-existent file on the command line"

Closes #405

See merge request pycqa/flake8!227
2018-04-15 23:33:40 +00:00
Craig Silverstein
c16c0c9041 Do better testing that we actually call run_serial(). 2018-03-02 21:01:47 -08:00
Craig Silverstein
a5573fc864 Move all uses of pool inside run_parallel().
This includes creating the pool, tearing it down under normal use, and
tearing it down in case of exception.

Doing this makes it harder to leak processes, as for instance was
happening in #410.

Fixes #410
2018-03-02 20:49:31 -08:00
Avraham Shukron
59218ca323 Report error when non-exiting path is passed to flake8 2018-02-21 18:19:59 +02:00
Ian Stapleton Cordasco
49f0fbcf1e
Respect a formatter's newline setting when printing
In working on flake8-json, I noticed that setting newline was only
helpful for writing to an ouput-file but not to standard-out. It makes
sense for this setting to apply to both branches otherwise plugins need
to override the method to get the behaviour they expect.
2017-12-31 18:50:59 -06:00
Ian Stapleton Cordasco
3530870679 Merge branch 'local-plugin-paths' into 'master'
Add paths option in local-plugins config file.

Closes #379

See merge request pycqa/flake8!211
2017-11-26 18:40:04 +00:00
Ian Stapleton Cordasco
c60546e896
Add pep8-naming to flake8 linting 2017-11-26 11:25:09 -06:00
Ian Stapleton Cordasco
a3a2539a23
Fix-up new I202 violations 2017-11-26 11:25:06 -06:00
Carl Meyer
423980164b Add paths option in local-plugins config file. 2017-10-24 19:58:18 -07:00
Anthony Sottile
fdcee0259d Fix failing encoding test on appveyor 2017-10-19 08:33:55 -07:00
Anthony Sottile
bbe8d6d6c6 Catch UnicodeDecodeError while parsing config files 2017-10-09 09:52:37 -07:00
Ian Stapleton Cordasco
222f0a8115
Allow our local plugin parsing to accept commas
By slightly modifying our utility function to parse comma separated
lists we can parse local plugins similar to other configuration options.
2017-08-09 19:35:01 -05:00
Ian Stapleton Cordasco
156f90369f
Update our plugin registration for debugging
This allows us to report whether or not a plugin is local when users
provide `flake8 --bug-report` output.
2017-08-08 08:54:40 -05:00
Carl Meyer
54a8a551b3 Fix finding of local config files. 2017-08-07 17:57:25 -07:00
Carl Meyer
ca3c4d2545 Simplify application tests; remove unneeded mocking 2017-08-07 13:56:54 -07:00
Carl Meyer
18c0b14b5c Append [local] to version of local plugins. 2017-08-06 20:57:04 -07:00
Carl Meyer
4e58068657 Add support for local (in-repo, non-setuptools) plugins.
Closes #357
2017-08-03 00:25:37 -07:00
Ian Stapleton Cordasco
ec996ffd85
Allow spaces in # noqa lists
To match our new configuration file format and its allowance for spaces
in the list

Closes #356
2017-07-28 19:31:32 -05:00
Ian Stapleton Cordasco
a44a09f87a
Remediate one wafer thing decision logic bug
Previously we were hitting the catch-all return that decided the error
was selected. Instead, let's add specific logic since we now know how we
would hit that and we actually don't want it to be selected.

Closes #354
2017-07-28 06:10:12 -05:00
Shinya Kawaguchi
98b9946a78 Reproduce quiet/verbose config problem 2017-07-22 16:18:58 +09:00
Ian Cordasco
ff07ca3ed9
Add some better comments for decision logic 2017-06-04 15:07:10 -05:00
Ian Cordasco
e8c6a1e2f5
Get *one* more line of test coverage
This was mostly to prove to myself that we could possibly reach that
return more than actually covering that return. This just shows how
gnarly this logic actually is. I wish there were a better way to write
it.
2017-06-04 14:51:01 -05:00
Ian Cordasco
92c367dee4
Rename style_guide.Error to style_guide.Violation
Move all Violation related methods from the StyleGuide to our Violation
class.
2017-06-04 07:57:28 -05:00
Ian Cordasco
65107a5624
Rename methods on the new DecisionEngine
Rename `decision_for` to `more_specific_decision_for` and
`should_report_error` to `decision_for`.
2017-06-03 19:20:46 -05:00
Ian Cordasco
583fda7a70
Move unit tests for StyleGuide decision logic
Convert it to test the DecisionEngine class directly and put them in
their own file.
2017-06-02 19:16:28 -05:00
Ian Cordasco
7fef0af0f5
Refactor decision logic into its own object
In dealing with the decision logic in the StyleGuide recently I
recognized that the logic really doesn't belong strictly on the
StyleGuide. A separate object makes perfect sense especially from the
perspective of testability. This is a minor refactor intended solely to
facilitate further testing and perhaps making the logic easier to
understand for others.
2017-06-01 20:36:37 -05:00
Ian Cordasco
feec0754bd
Add debugging utility for FileChecker 2017-06-01 20:06:34 -05:00
Ian Cordasco
fec980a856 Merge branch 'bug/318' into 'master'
Further improve our handling of --select and --ignore

Closes #318

See merge request !187
2017-05-28 01:41:13 +00:00
Ian Cordasco
aefa79535f
Simplify conditoinal in decision logic
Add test to cover branch of decision logic we were not previously
exercising
2017-05-27 20:34:04 -05:00
Ian Cordasco
178092954d
Add extra test cases for violation decisions 2017-05-27 20:16:15 -05:00
Ian Cordasco
2baaf00e83
Further refine our logic handling selection
There was a *very* subtle bug in how we handle blanket select statements
with error codes that are in our DEFAULT_IGNORE. In the specific case,
users were specifying ``--select E`` and E126 was not being properly
reported. This unveiled further logic bugs as we refined this.

Closes #318
2017-05-27 19:22:38 -05:00
Jon Dufresne
db4f71288e Prefer iter(dict) instead of dict.keys()
They are equivalent for iterating so remove the additional function
call.

Pattern identified as outdated by Lennart Regebro's PyCon 2017 talk
"Prehistoric Patterns in Python"

https://www.youtube.com/watch?v=V5-JH23Vk0I
2017-05-27 11:54:06 -07:00
Ian Cordasco
a42299d008
Support spaces as error/ignore code separators
Closes #329
2017-05-25 20:07:48 -05:00
Ian Cordasco
25566468a2
Filter out empty ignore/select codes
When we parse out our comma separated lists, we should ignore empty
strings to avoid them breaking users' expectations.

Closes #330
2017-05-20 20:26:27 -05:00
Jon Dufresne
541bac6a82 Clean up some uses of set, list, and dict
* Use set literals instead of set([...])
* Avoid list(sorted(...)) as sorted returns a list
* Replace dict() with dict literal
2017-05-13 07:14:41 -07:00
Ian Cordasco
c62de6acc3
Make formatting plugin logic easier to test
By splitting out the logic to retrieve and return the formatting class
for an application, we can test it more easily and increase our test
coverage of this critical logic.

Refs #320
2017-05-13 08:00:43 -05:00
Ian Cordasco
32f4b65b6b
Fix docstring violations 2017-05-12 20:34:15 -05:00
Anthony Sottile
0559e0b43c Don't apply excludes greedily to subdirs 2017-03-16 13:44:33 -07:00
Ian Cordasco
9f8dfd924a
Return similarly named, non-submodule modules
In our setuptools integration command, we were attempting to avoid
checking each submodule in the packages list. This was done without
recognizing that two modules may start with the same prefix, e.g.,

- foo
- foo_bar
- foo_biz

In this case, we only ever checked ``foo``. By appending a '.' to the
end of each package name, we avoid this since we only care about
deduplicating submodules, e.g.,

- foo
- foo.sub
- foo.sub.sub

Closes #295
2017-01-22 15:00:48 -06:00