Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new CLI options for skipping a number of lines at the beginning and end of a file from being checked #143

Closed
wants to merge 4 commits into from

Conversation

Projects
None yet
3 participants
@pizen
Copy link

commented Dec 12, 2012

I work with lots of Python code that resides in files where there is non-Python header and footer information in the files that is necessary for the larger system. These header and footer lines throw the pep8 checker off so I've added these CLI options that allow these lines to be ignored during the check. If the check is being run against a directory these options apply to all files found and checked.

New options:
--skip-first-lines=n
Prevents the first n lines of the file from being run through the checker. The line numbers are unaffected. If n=2 and there is an error on line 3 of the file pep8 will still report the error as being on line 3.

--skip-last-lines=n
Prevents the last n lines of the file from being run through the checker.

@glarrain

This comment has been minimized.

Copy link

commented Dec 12, 2012

Great contribution! +1

@florentx

This comment has been minimized.

Copy link
Contributor

commented Dec 22, 2012

Most users will not need this feature. I prefer to keep it out of the core library.

However I re-used your proposal as an example for advanced usage:
https://pep8.readthedocs.org/en/latest/advanced.html#skip-file-header

Thank you.

@florentx florentx closed this Dec 22, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.