-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9243 from steff456/remove_pyflakes_pep8_checks
PR: Remove unused Pyflakes and Pep8 check functions
- Loading branch information
Showing
7 changed files
with
38 additions
and
253 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
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,33 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright © Spyder Project Contributors | ||
# Licensed under the terms of the MIT License | ||
# (see spyder/__init__.py for details) | ||
|
||
""" | ||
Source code analysis utilities. | ||
""" | ||
|
||
import re | ||
|
||
# Local import | ||
from spyder.config.base import get_debug_level | ||
|
||
DEBUG_EDITOR = get_debug_level() >= 3 | ||
|
||
# ============================================================================= | ||
# Find tasks - TODOs | ||
# ============================================================================= | ||
TASKS_PATTERN = r"(^|#)[ ]*(TODO|FIXME|XXX|HINT|TIP|@todo|" \ | ||
r"HACK|BUG|OPTIMIZE|!!!|\?\?\?)([^#]*)" | ||
|
||
|
||
def find_tasks(source_code): | ||
"""Find tasks in source code (TODO, FIXME, XXX, ...).""" | ||
results = [] | ||
for line, text in enumerate(source_code.splitlines()): | ||
for todo in re.findall(TASKS_PATTERN, text): | ||
todo_text = (todo[-1].strip(' :').capitalize() if todo[-1] | ||
else todo[-2]) | ||
results.append((todo_text, line + 1)) | ||
return results |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.