Closed miki725 closed 9 years ago
cc @agamdua
@gregarmer I think I addressed both comment in https://github.com/miki725/flake8-diff/commit/42a9e31dbacd7323c1bcb40146f9e8541c72373b. Let me know what you think.
else
since it is not necessary as AttributeError
will be thrown in __init__
if strict mode is not implemented.file
strict mode is cached by replacing the whole function which always returns True
@miki725 there's just one method rename left, then we can merge this.
thanks @gregarmer for reminder. just updated
flake8 can be fooled. for example:
technically there is now a violation on
Bar
since there are too many blank lines however flake8-diff will not detect it since the diff only added the blank lines which is not where violation is.The idea of strict modes is to allow to choose how files are evaluated.
only_lines
- default and existing behaviour which only counts violations when that specific line is added and it has a violationfile
- uses all violations from any modified files in the diffpossible strict modes for the future
percent_file
- uses all violations from any modified files when specific percent of lines was modified in the file. for example if only 2 lines were modified in 1000 line file, dont bother, but on the other hand if 600 lines were modified, then probably a good idea to lint the whole file, same asfile
strict mode