-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Bug 2957 #3076
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
Merged
Merged
Bug 2957 #3076
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
9b7d57d
Move the test about finding #pylint:diable at the end of a line in a …
hippo91 4eebb71
Merge branch 'master' into bug_2957
hippo91 97ce381
using split instead of search and then processing each match
hippo91 71a4847
Splitting check_line in two methods check_line_ending and check_line_…
hippo91 20773d1
Merge branch 'master' into bug_2957
hippo91 33174b5
Add a test that check the disable line-too-long comment works on mult…
hippo91 ef62924
Add a test that check the disable line-too-long comment works on mult…
hippo91 1441b9c
Reformat
hippo91 1d5ae3e
Reinforces the unit test to ensure only multiline strings are conside…
hippo91 de3e916
Add a comment
hippo91 e676dd4
Corrects the unit test
hippo91 39a7646
Creates the remove_pylint_option_from_lines function
hippo91 a131c52
Add the is_line_length_check_deactivated function
hippo91 3ba906b
Reformat.
hippo91 268e82c
Merge branch 'master' into bug_2957
hippo91 4fb1ba7
Create the function specific_split
hippo91 6700f01
Simplify the specific_split function
hippo91 612e6fc
Rename specific_split function into specific_splitlines and reformat it
hippo91 4b03198
Convert closures into methods or staticmethods. Clarifies the check_l…
hippo91 33f7e63
The is_line_check_deactivated method is changed into is_line_check_ac…
hippo91 142cf69
The incrementation of line counter is not made in check_line_ending m…
hippo91 76e5815
Reformat and add comment
hippo91 0bad8d9
Add an entry concerning line-too-long message emission and multilines
hippo91 716e16e
Format according to black
hippo91 0c19f31
Merge branch 'master' into bug_2957
hippo91 d90e6d6
Adds the import of List from typing module and corrects the return ty…
hippo91 eec5bc9
Change the way final newline are detected in the metod remove_pylint_…
hippo91 7dbd60d
Change the way final newline are appended in the metod remove_pylint_…
hippo91 8e4352f
A linesep is inserted at the end of line after removing the #pylint: …
hippo91 5f89d2c
Delete dead code.
hippo91 33a8327
Add a first draft of pragma_parser
hippo91 5a41243
First use of pragma_parser
hippo91 0421d3b
Merge branch 'master' into bug_2957
hippo91 bbde005
Modify the OPTION_RGX so that the first match group corresponds to #p…
hippo91 aea135b
Use the parse_pragma module to analyze the pylint options.
hippo91 bff9247
Use of specific matched group to parse pragma
hippo91 e62e366
Uses the new parse_pragma fonction intead of the old constants.OPTION…
hippo91 b1211bd
Adds a specific exception in case the pragma is not valid.
hippo91 f3048fb
Only specific keywords should be followed by assignment.
hippo91 f8b155a
Add unit tests for pragma_parser module
hippo91 e8d73f6
Adds multiple specific exceptions. Improve error detections.
hippo91 a15357d
Takes into account potential catching of PragmaParserException
hippo91 fe38cb3
bad-inline option should reflect a licit but bad build option
hippo91 f406ba8
The PragmaRepresenter can be emitted if messages is empty only for so…
hippo91 31fb88b
Rewrite partially process_tokens method in order to take into accound…
hippo91 cf54723
Add a fonction to test a simple pragma with keyword that does not req…
hippo91 b54f4bc
Deleting test that could not occur due to use of parse_pragma
hippo91 e2d4a1a
Move and rename the pragma parser unit tests
hippo91 3282848
Move and rename the pragma parser unit tests
hippo91 fe3bd4c
Reformatting according to black and sorting imports
hippo91 4c706e8
Merge branch 'master' into bug_2957
hippo91 f6c5b4c
Correcting errors shown by linters
hippo91 4e202cd
Reformatting according to black
hippo91 2515b19
Merge branch 'master' into bug_2957
hippo91 acd9019
Moving doc to 2.5 section
hippo91 80a5edb
Changing the type annotation to type comment to be compatible with py…
hippo91 7255800
Change the keyword collections into frozensets
hippo91 ad9a99e
Reduces the number of exceptions. Only two remain : UnRecognizedOptio…
hippo91 c874aec
Takes into account the change in the exceptions of the pragma_parser …
hippo91 e9c07b4
Formatting according to black
hippo91 fe01ce0
Merge branch 'master' into bug_2957
hippo91 6a88e79
The keywords are sorted according to their length.
hippo91 7f8e8d8
Merge branch 'master' into bug_2957
hippo91 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, but I wonder if we should have a parsing utility for the pragmas, since the current approach might be brittle.
We could add a function in
pylint.utils
or somewhere that from a pragma string, returns what messages were used and the action of the pragma. Maybe something along the lines of:pragma = parse_pragma(match_object.string)
if pragma.action == 'disable' and 'line-too-long' in pragma.messages:
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PCManticore it's a good idea. It could definitely improve the way we interact with pragmas.
I will give it at try right now.