make check_length work for projects other than Launchpad
Bug #923309 reported by
Adi Roiban
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pocket-lint |
Fix Released
|
Medium
|
Adi Roiban |
Bug Description
Right now, the formatchecker has a /lib/lp hardcoded as the condition for checking a non-PEP line length .
In case other projects are using a non-PEP line length it would be nice if pocket-lint will allow some soft of easy customization.
I have attached a branch with adds a degree of customization. It uses a dedicated method for filtering line length checks and returning the length of the line.
Users can path BaseChecker and PythonChecker to change the behavior of check_length.
Another approach would be to add an argument to UniversalChecker and pass the method as argument, but for me, the manual patching looks good enough.
Related branches
lp:~adiroiban/pocket-lint/923309
- Curtis Hovey: Approve (code)
-
Diff: 64 lines (+18/-8)1 file modifiedpocketlint/formatcheck.py (+18/-8)
summary: |
- make check_lenght work for projects other than Launchpad + make check_length work for projects other than Launchpad |
Changed in pocket-lint: | |
status: | New → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → Adi Roiban (adiroiban) |
Changed in pocket-lint: | |
milestone: | none → future |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
You can now specify the max length using --max-length or -m command line args. The default max length is 80. To verify that a text file conforms to email line-length, you can run this:
pocketlint -m 72
To verify Lp's rules set the max-length to 78:
pocketlint -m 72