-
-
Notifications
You must be signed in to change notification settings - Fork 13
Issue 20: Exercise Names + A Refactor to Bring Into Spec Compliance #22
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
Changes from 8 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
e3f1cb1
Changed imported names to match refactor.
BethanyG f725721
Added functionality to formulate paths and slugs from config.json.
BethanyG f13314f
Functions to create and process pylint comments and reports.
BethanyG be39341
Moved the Status class to common/comment.py and renamed it to Summary…
BethanyG 650ec1f
Added dataclass Comment and Enum CommentTypes. Renamed and refactore…
BethanyG c6b2821
Removed checks for approval status from tests. Renamed references to…
BethanyG 6db5c8a
Refactored and removed pylint code to its own file. General renaming…
BethanyG ce07338
Removed extra directory level from comment pointer string for pylint.
BethanyG c44e609
Added an init to make pytest happier.
BethanyG ebb7503
Added classmethod to process analyzer comments and add Analysis summa…
BethanyG 749abd0
Refactored tests to match renamed and re-arranged code.
BethanyG accb6b8
Moved comment summarization code out of module to Analysis.py, and ma…
BethanyG 2b60c38
General test refactoring and work to make tests pass with new code re…
BethanyG 085606c
Added CI workflow.
BethanyG 0b4e3cb
Added dec-requirements.txt to buld for CI.
BethanyG 259de53
Added pytest to a dev-requirements file.
BethanyG 26aef3d
Added and on PR condition.
BethanyG 98ac9df
Master to main.
BethanyG 23aa85c
Removed the erronous .py from dev-requirements.txt.
BethanyG cecdb4c
Update dev-requirements.txt.py
BethanyG ffbefa8
Update lib/common/__init__.py
BethanyG 0e18ff1
Update lib/common/comment.py
BethanyG 99c32eb
Update lib/common/pylint_comments.py
BethanyG 07be9de
Update lib/common/analysis.py
BethanyG 6a61423
Update lib/common/comment.py
BethanyG 32793ef
Update lib/common/comment.py
BethanyG 82d5033
Update lib/common/comment.py
BethanyG 5d713bf
Delete dev-requirements.txt.py
BethanyG 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from common.comment import Comment, CommentTypes | ||
from pylint import epylint as lint | ||
from pathlib import Path | ||
|
||
|
||
def generate_pylint_comments(in_path): | ||
''' | ||
Use Pylint to generate additional feedback comments for code, | ||
|
||
e.g. if code follows PEP8 Style Convention | ||
''' | ||
|
||
pylint_stdout, _ = lint.py_run( | ||
str(in_path) + ' --score=no --msg-template="{category}, {line}, {msg_id} {symbol}, {msg}"', | ||
return_std=True | ||
) | ||
|
||
status_mapping = { | ||
'informational': CommentTypes.INFORMATIVE, | ||
'refactor' : CommentTypes.ACTIONABLE, | ||
'convention' : CommentTypes.ACTIONABLE, | ||
'warning' : CommentTypes.ESSENTIAL, | ||
'error' : CommentTypes.ESSENTIAL, | ||
'fatal' : CommentTypes.ESSENTIAL | ||
} | ||
|
||
cleaned_pylint_output = [tuple(item.strip('" ').split(', ')) | ||
for item in pylint_stdout.getvalue().splitlines() | ||
if '**' not in item] | ||
|
||
pylint_comments = [] | ||
|
||
for line in cleaned_pylint_output: | ||
if line[0]: | ||
pylint_comments.append(Comment(type=status_mapping[line[0]], | ||
params={'lineno': line[1], 'code': line[2], 'message': line[3]}, | ||
comment=f'python.pylint.{line[0]}')) | ||
|
||
return pylint_comments | ||
BethanyG marked this conversation as resolved.
Show resolved
Hide resolved
|
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.
Uh oh!
There was an error while loading. Please reload this page.