-
Notifications
You must be signed in to change notification settings - Fork 63
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
New configuration option - Allowing "pylint:" commments #973
Conversation
Pull Request Test Coverage Report for Build 6915840675
💛 - Coveralls |
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.
@AinaMerch great work, I've left a few comments to address.
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.
@AinaMerch okay great progress. I've left some more comments, plus a larger note to focus on formalizing test cases for these changes.
Additionally, please make sure to update the Changelog with a new entry under "Enhancements" to describe this change.
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.
@AinaMerch great, I left a few more comments but I think this is very close!
python_ta/__init__.py
Outdated
def _verify_pre_check(filepath: AnyStr, allow_pylint_comments: bool) -> bool: | ||
"""Check student code for certain issues. | ||
The additional allow_pylint_comments parameter indicates whether we want the user to be able to add comments | ||
beginning with pylint which can be used to locally disable checks.""" |
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.
Put the ending """
on a new line (this is the style we use when there's a multi-line docstring)
tests/test_config/test_config.py
Outdated
|
||
def test_allow_pylint_comments() -> None: | ||
"""Test that checks whether the allow-pylint-comments configuration option works as expected when it is | ||
set to True""" |
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.
As above, make sure the ending """
is on a new line. Same with the second test case below.
Motivation and Context
PythonTA currently looks for a comment that starts with "pylint:" and, if present, does not check the file. I added a new configuration option to let the user customize whether they want to allow or disallow "pylint:" comments. Also add ed documentation for this under the PythonTA configuration page. Added 2 test files alongside.
Your Changes
Added configuration to allow "pylint:" comments through modifying the pylintrc and init.py files. Added documentation to configuration.md.
Description:
Type of change (select all that apply):
Testing
Added 2 test files, allow_pylint_comments_true_testcase.py and allow_pylint_comments_false_testcase.py to check that the config option does what is required.
Questions and Comments (if applicable)
Checklist