Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ignore-overlong-task-comments setting
Imagine a .py file containing the following comment: # TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed # do eiusmod tempor incididunt ut labore et dolore magna aliqua. Since `git grep` only matches individual lines `git grep TODO` would only output the first line of the comment, cutting off potentially important information. (git grep currently doesn't support multiline grepping). Projects using such a workflow therefore probably format the comment in a single line instead: # TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. This commit introduces a setting to accomdate this workflow by making the line-length checks (`E501`) optionally ignore overlong lines if they start with a recognized task tag. Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
- Loading branch information
1 parent
3261605
commit 2c79c82
Showing
10 changed files
with
184 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# TODO: comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` | ||
# TODO comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` | ||
# TODO comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` | ||
# FIXME: comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` | ||
# FIXME comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` | ||
# FIXME comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
src/pycodestyle/snapshots/ruff__pycodestyle__tests__task_tags_false.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
source: src/pycodestyle/mod.rs | ||
expression: checks | ||
--- | ||
- kind: | ||
LineTooLong: | ||
- 149 | ||
- 88 | ||
location: | ||
row: 1 | ||
column: 88 | ||
end_location: | ||
row: 1 | ||
column: 149 | ||
fix: ~ | ||
parent: ~ | ||
- kind: | ||
LineTooLong: | ||
- 148 | ||
- 88 | ||
location: | ||
row: 2 | ||
column: 88 | ||
end_location: | ||
row: 2 | ||
column: 148 | ||
fix: ~ | ||
parent: ~ | ||
- kind: | ||
LineTooLong: | ||
- 155 | ||
- 88 | ||
location: | ||
row: 3 | ||
column: 88 | ||
end_location: | ||
row: 3 | ||
column: 155 | ||
fix: ~ | ||
parent: ~ | ||
- kind: | ||
LineTooLong: | ||
- 150 | ||
- 88 | ||
location: | ||
row: 4 | ||
column: 88 | ||
end_location: | ||
row: 4 | ||
column: 150 | ||
fix: ~ | ||
parent: ~ | ||
- kind: | ||
LineTooLong: | ||
- 149 | ||
- 88 | ||
location: | ||
row: 5 | ||
column: 88 | ||
end_location: | ||
row: 5 | ||
column: 149 | ||
fix: ~ | ||
parent: ~ | ||
- kind: | ||
LineTooLong: | ||
- 156 | ||
- 88 | ||
location: | ||
row: 6 | ||
column: 88 | ||
end_location: | ||
row: 6 | ||
column: 156 | ||
fix: ~ | ||
parent: ~ | ||
|
6 changes: 6 additions & 0 deletions
6
src/pycodestyle/snapshots/ruff__pycodestyle__tests__task_tags_true.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
source: src/pycodestyle/mod.rs | ||
expression: checks | ||
--- | ||
[] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters