From 3fd4c69159319f1752ad42e7af986c53496e9982 Mon Sep 17 00:00:00 2001 From: BethanyG Date: Fri, 27 Feb 2026 16:15:34 -0800 Subject: [PATCH] Turned off general recommendations in all analyzers and added dnd-character test. Re-recorded golden test files. --- lib/common/generic_analyzer/analyzer.py | 5 +- lib/currency-exchange/analyzer.py | 4 +- lib/ellens-alien-game/analyzer.py | 4 +- lib/ghost-gobble-arcade-game/analyzer.py | 4 +- lib/guidos-gorgeous-lasagna/analyzer.py | 4 +- lib/inventory-management/analyzer.py | 4 +- lib/little-sisters-essay/analyzer.py | 4 +- lib/little-sisters-vocab/analyzer.py | 4 +- lib/log-levels/analyzer.py | 4 +- lib/making-the-grade/analyzer.py | 4 +- lib/meltdown-mitigation/analyzer.py | 4 +- lib/pretty-leaflet/analyzer.py | 4 +- lib/processing-logs/analyzer.py | 4 +- lib/restaurant-rozalynn/analyzer.py | 4 +- lib/tisbury-treasure-hunt/analyzer.py | 4 +- test/anagram/analysis.json | 8 +-- test/currency-exchange/analysis.json | 8 +-- test/dnd-character/analysis.json | 70 +++++++++++++++++++++ test/ellens-alien-game/analysis.json | 8 +-- test/ghost-gobble-arcade-game/analysis.json | 8 +-- test/inventory-management/analysis.json | 8 +-- test/little-sisters-essay/analysis.json | 8 +-- test/little-sisters-vocab/analysis.json | 8 +-- test/locomotive-engineer/analysis.json | 8 +-- test/tisbury-treasure-hunt/analysis.json | 8 +-- 25 files changed, 110 insertions(+), 93 deletions(-) create mode 100644 test/dnd-character/analysis.json diff --git a/lib/common/generic_analyzer/analyzer.py b/lib/common/generic_analyzer/analyzer.py index 17b6cae..6b22e07 100644 --- a/lib/common/generic_analyzer/analyzer.py +++ b/lib/common/generic_analyzer/analyzer.py @@ -62,7 +62,8 @@ def analyze(in_path: Path, out_path: Path): comments.extend(generate_pylint_comments(in_path)) # If there are no comments, add the general recommendations as comments. - if not comments: - comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) + # We're disabling this for now, until we can find a better way to present these. + # if not comments: + # comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) return Analysis.summarize_comments(comments, output_file) diff --git a/lib/currency-exchange/analyzer.py b/lib/currency-exchange/analyzer.py index 6bda1db..9cab6ef 100644 --- a/lib/currency-exchange/analyzer.py +++ b/lib/currency-exchange/analyzer.py @@ -60,7 +60,7 @@ def analyze(in_path: Path, out_path: Path): comments.extend(generate_pylint_comments(in_path)) # If there are no comments, add the general recommendations as comments. - if not comments: - comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) + # if not comments: + # comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) return Analysis.summarize_comments(comments, output_file) diff --git a/lib/ellens-alien-game/analyzer.py b/lib/ellens-alien-game/analyzer.py index 8f35024..e24d652 100644 --- a/lib/ellens-alien-game/analyzer.py +++ b/lib/ellens-alien-game/analyzer.py @@ -60,7 +60,7 @@ def analyze(in_path: Path, out_path: Path): comments.extend(generate_pylint_comments(in_path)) # If there are no comments, add the general recommendations as comments. - if not comments: - comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) + # if not comments: + # comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) return Analysis.summarize_comments(comments, output_file) diff --git a/lib/ghost-gobble-arcade-game/analyzer.py b/lib/ghost-gobble-arcade-game/analyzer.py index ce53a4b..a8bdbd3 100644 --- a/lib/ghost-gobble-arcade-game/analyzer.py +++ b/lib/ghost-gobble-arcade-game/analyzer.py @@ -60,7 +60,7 @@ def analyze(in_path: Path, out_path: Path): comments.extend(generate_pylint_comments(in_path)) # If there are no comments, add the general recommendations as comments. - if not comments: - comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) + # if not comments: + # comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) return Analysis.summarize_comments(comments, output_file) diff --git a/lib/guidos-gorgeous-lasagna/analyzer.py b/lib/guidos-gorgeous-lasagna/analyzer.py index 22f7cd3..8b4c33b 100644 --- a/lib/guidos-gorgeous-lasagna/analyzer.py +++ b/lib/guidos-gorgeous-lasagna/analyzer.py @@ -60,7 +60,7 @@ def analyze(in_path: Path, out_path: Path): comments.extend(generate_pylint_comments(in_path)) # If there are no comments, add the general recommendations as comments. - if not comments: - comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) + # if not comments: + # comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) return Analysis.summarize_comments(comments, output_file) diff --git a/lib/inventory-management/analyzer.py b/lib/inventory-management/analyzer.py index 9b55389..9edc0a4 100644 --- a/lib/inventory-management/analyzer.py +++ b/lib/inventory-management/analyzer.py @@ -60,7 +60,7 @@ def analyze(in_path: Path, out_path: Path): comments.extend(generate_pylint_comments(in_path)) # If there are no comments, add the general recommendations as comments. - if not comments: - comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) + # if not comments: + # comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) return Analysis.summarize_comments(comments, output_file) diff --git a/lib/little-sisters-essay/analyzer.py b/lib/little-sisters-essay/analyzer.py index b44fd10..e3f650c 100644 --- a/lib/little-sisters-essay/analyzer.py +++ b/lib/little-sisters-essay/analyzer.py @@ -60,7 +60,7 @@ def analyze(in_path: Path, out_path: Path): comments.extend(generate_pylint_comments(in_path)) # If there are no comments, add the general recommendations as comments. - if not comments: - comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) + # if not comments: + # comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) return Analysis.summarize_comments(comments, output_file) diff --git a/lib/little-sisters-vocab/analyzer.py b/lib/little-sisters-vocab/analyzer.py index bb79f71..5a47b98 100644 --- a/lib/little-sisters-vocab/analyzer.py +++ b/lib/little-sisters-vocab/analyzer.py @@ -60,7 +60,7 @@ def analyze(in_path: Path, out_path: Path): comments.extend(generate_pylint_comments(in_path)) # If there are no comments, add the general recommendations as comments. - if not comments: - comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) + # if not comments: + # comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) return Analysis.summarize_comments(comments, output_file) diff --git a/lib/log-levels/analyzer.py b/lib/log-levels/analyzer.py index 7e8802e..83fabc8 100644 --- a/lib/log-levels/analyzer.py +++ b/lib/log-levels/analyzer.py @@ -59,7 +59,7 @@ def analyze(in_path: Path, out_path: Path): comments.extend(generate_pylint_comments(in_path)) # If there are no comments, add the general recommendations as comments. - if not comments: - comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) + # if not comments: + # comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) return Analysis.summarize_comments(comments, output_file) diff --git a/lib/making-the-grade/analyzer.py b/lib/making-the-grade/analyzer.py index edb3722..8f34b45 100644 --- a/lib/making-the-grade/analyzer.py +++ b/lib/making-the-grade/analyzer.py @@ -60,7 +60,7 @@ def analyze(in_path: Path, out_path: Path): comments.extend(generate_pylint_comments(in_path)) # If there are no comments, add the general recommendations as comments. - if not comments: - comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) + # if not comments: + # comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) return Analysis.summarize_comments(comments, output_file) diff --git a/lib/meltdown-mitigation/analyzer.py b/lib/meltdown-mitigation/analyzer.py index 18a7a2d..426ea04 100644 --- a/lib/meltdown-mitigation/analyzer.py +++ b/lib/meltdown-mitigation/analyzer.py @@ -60,7 +60,7 @@ def analyze(in_path: Path, out_path: Path): comments.extend(generate_pylint_comments(in_path)) # If there are no comments, add the general recommendations as comments. - if not comments: - comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) + # if not comments: + # comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) return Analysis.summarize_comments(comments, output_file) diff --git a/lib/pretty-leaflet/analyzer.py b/lib/pretty-leaflet/analyzer.py index 6136750..5e4ccd1 100644 --- a/lib/pretty-leaflet/analyzer.py +++ b/lib/pretty-leaflet/analyzer.py @@ -59,7 +59,7 @@ def analyze(in_path: Path, out_path: Path): comments.extend(generate_pylint_comments(in_path)) # If there are no comments, add the general recommendations as comments. - if not comments: - comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) + # if not comments: + # comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) return Analysis.summarize_comments(comments, output_file) diff --git a/lib/processing-logs/analyzer.py b/lib/processing-logs/analyzer.py index 6136750..5e4ccd1 100644 --- a/lib/processing-logs/analyzer.py +++ b/lib/processing-logs/analyzer.py @@ -59,7 +59,7 @@ def analyze(in_path: Path, out_path: Path): comments.extend(generate_pylint_comments(in_path)) # If there are no comments, add the general recommendations as comments. - if not comments: - comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) + # if not comments: + # comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) return Analysis.summarize_comments(comments, output_file) diff --git a/lib/restaurant-rozalynn/analyzer.py b/lib/restaurant-rozalynn/analyzer.py index aa0e529..33a4490 100644 --- a/lib/restaurant-rozalynn/analyzer.py +++ b/lib/restaurant-rozalynn/analyzer.py @@ -60,7 +60,7 @@ def analyze(in_path: Path, out_path: Path): comments.extend(generate_pylint_comments(in_path)) # If there are no comments, add the general recommendations as comments. - if not comments: - comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) + # if not comments: + # comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) return Analysis.summarize_comments(comments, output_file) diff --git a/lib/tisbury-treasure-hunt/analyzer.py b/lib/tisbury-treasure-hunt/analyzer.py index 9c29f04..4033877 100644 --- a/lib/tisbury-treasure-hunt/analyzer.py +++ b/lib/tisbury-treasure-hunt/analyzer.py @@ -60,7 +60,7 @@ def analyze(in_path: Path, out_path: Path): comments.extend(generate_pylint_comments(in_path)) # If there are no comments, add the general recommendations as comments. - if not comments: - comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) + # if not comments: + # comments.append(Comment(type=CommentTypes.INFORMATIVE, params={}, comment=Comments.GENERAL_RECS)) return Analysis.summarize_comments(comments, output_file) diff --git a/test/anagram/analysis.json b/test/anagram/analysis.json index 464bec9..7f28a1b 100644 --- a/test/anagram/analysis.json +++ b/test/anagram/analysis.json @@ -1,10 +1,4 @@ { "summary": "Good work! \ud83c\udf1f Here are some general recommendations for improving your Python code.", - "comments": [ - { - "comment": "python.general.general_recommendations", - "params": {}, - "type": "informative" - } - ] + "comments": [] } \ No newline at end of file diff --git a/test/currency-exchange/analysis.json b/test/currency-exchange/analysis.json index 464bec9..7f28a1b 100644 --- a/test/currency-exchange/analysis.json +++ b/test/currency-exchange/analysis.json @@ -1,10 +1,4 @@ { "summary": "Good work! \ud83c\udf1f Here are some general recommendations for improving your Python code.", - "comments": [ - { - "comment": "python.general.general_recommendations", - "params": {}, - "type": "informative" - } - ] + "comments": [] } \ No newline at end of file diff --git a/test/dnd-character/analysis.json b/test/dnd-character/analysis.json new file mode 100644 index 0000000..7714852 --- /dev/null +++ b/test/dnd-character/analysis.json @@ -0,0 +1,70 @@ +{ + "summary": "There are a few suggested changes that can bring your solution closer to ideal.", + "comments": [ + { + "comment": "python.pylint.convention", + "params": { + "lineno": "1", + "code": "C0114 missing-module-docstring", + "message": "Missing module docstring", + "bad_code": "Instead of: \n```python\nimport sys # [missing-module-docstring]\n\n\ndef print_python_version():\n print(sys.version)\n```\n\n", + "good_code": "Try: \n```python\n\"\"\"Module providing a function printing python version.\"\"\"\n\nimport sys\n\n\ndef print_python_version():\n print(sys.version)\n```\n\n", + "related_info": null, + "details": null + }, + "type": "informative" + }, + { + "comment": "python.pylint.convention", + "params": { + "lineno": "4", + "code": "C0115 missing-class-docstring", + "message": "Missing class docstring", + "bad_code": "Instead of: \n```python\nclass Person: # [missing-class-docstring]\n def __init__(self, first_name, last_name):\n self.first_name = first_name\n self.last_name = last_name\n```\n\n", + "good_code": "Try: \n```python\nclass Person:\n \"\"\"Class representing a person\"\"\"\n\n def __init__(self, first_name, last_name):\n self.first_name = first_name\n self.last_name = last_name\n```\n\n", + "related_info": null, + "details": null + }, + "type": "actionable" + }, + { + "comment": "python.pylint.refactor", + "params": { + "lineno": "16", + "code": "R1721 unnecessary-comprehension", + "message": "Unnecessary use of a comprehension, use list(vars(self).values()) instead.", + "bad_code": "Instead of: \n```python\nNUMBERS = [1, 1, 2, 2, 3, 3]\n\nUNIQUE_NUMBERS = {number for number in NUMBERS} # [unnecessary-comprehension]\n```\n\n", + "good_code": "Try: \n```python\nNUMBERS = [1, 1, 2, 2, 3, 3]\n\nUNIQUE_NUMBERS = set(NUMBERS)\n```\n\n", + "related_info": null, + "details": null + }, + "type": "actionable" + }, + { + "comment": "python.pylint.refactor", + "params": { + "lineno": "19", + "code": "R6301 no-self-use", + "message": "Method could be a function", + "bad_code": "Instead of: \n```python\nclass Person:\n def greeting(self): # [no-self-use]\n print(\"Greetings pythonista!\")\n```\n\n", + "good_code": "Try: \n```python\n# Function\ndef greeting():\n print(\"Greetings pythonista!\")\n\n\n# Static Method\nclass Person:\n @staticmethod\n def greeting():\n print(\"Greetings pythonista!\")\n\n# Use Self\nclass Person:\n name: str = \"Amelia\"\n\n def greeting(self):\n print(f\"Greetings {self.name} the pythonista!\")\n```\n\n", + "related_info": null, + "details": "If a function is not using any class attribute it can be a\n`@staticmethod`, or a function outside the class.\n" + }, + "type": "actionable" + }, + { + "comment": "python.pylint.refactor", + "params": { + "lineno": "19", + "code": "R6301 no-self-use", + "message": "Method could be a function", + "bad_code": "Instead of: \n```python\nclass Person:\n def greeting(self): # [no-self-use]\n print(\"Greetings pythonista!\")\n```\n\n", + "good_code": "Try: \n```python\n# Function\ndef greeting():\n print(\"Greetings pythonista!\")\n\n\n# Static Method\nclass Person:\n @staticmethod\n def greeting():\n print(\"Greetings pythonista!\")\n\n# Use Self\nclass Person:\n name: str = \"Amelia\"\n\n def greeting(self):\n print(f\"Greetings {self.name} the pythonista!\")\n```\n\n", + "related_info": null, + "details": "If a function is not using any class attribute it can be a\n`@staticmethod`, or a function outside the class.\n" + }, + "type": "actionable" + } + ] +} \ No newline at end of file diff --git a/test/ellens-alien-game/analysis.json b/test/ellens-alien-game/analysis.json index 464bec9..7f28a1b 100644 --- a/test/ellens-alien-game/analysis.json +++ b/test/ellens-alien-game/analysis.json @@ -1,10 +1,4 @@ { "summary": "Good work! \ud83c\udf1f Here are some general recommendations for improving your Python code.", - "comments": [ - { - "comment": "python.general.general_recommendations", - "params": {}, - "type": "informative" - } - ] + "comments": [] } \ No newline at end of file diff --git a/test/ghost-gobble-arcade-game/analysis.json b/test/ghost-gobble-arcade-game/analysis.json index 464bec9..7f28a1b 100644 --- a/test/ghost-gobble-arcade-game/analysis.json +++ b/test/ghost-gobble-arcade-game/analysis.json @@ -1,10 +1,4 @@ { "summary": "Good work! \ud83c\udf1f Here are some general recommendations for improving your Python code.", - "comments": [ - { - "comment": "python.general.general_recommendations", - "params": {}, - "type": "informative" - } - ] + "comments": [] } \ No newline at end of file diff --git a/test/inventory-management/analysis.json b/test/inventory-management/analysis.json index 464bec9..7f28a1b 100644 --- a/test/inventory-management/analysis.json +++ b/test/inventory-management/analysis.json @@ -1,10 +1,4 @@ { "summary": "Good work! \ud83c\udf1f Here are some general recommendations for improving your Python code.", - "comments": [ - { - "comment": "python.general.general_recommendations", - "params": {}, - "type": "informative" - } - ] + "comments": [] } \ No newline at end of file diff --git a/test/little-sisters-essay/analysis.json b/test/little-sisters-essay/analysis.json index 464bec9..7f28a1b 100644 --- a/test/little-sisters-essay/analysis.json +++ b/test/little-sisters-essay/analysis.json @@ -1,10 +1,4 @@ { "summary": "Good work! \ud83c\udf1f Here are some general recommendations for improving your Python code.", - "comments": [ - { - "comment": "python.general.general_recommendations", - "params": {}, - "type": "informative" - } - ] + "comments": [] } \ No newline at end of file diff --git a/test/little-sisters-vocab/analysis.json b/test/little-sisters-vocab/analysis.json index 464bec9..7f28a1b 100644 --- a/test/little-sisters-vocab/analysis.json +++ b/test/little-sisters-vocab/analysis.json @@ -1,10 +1,4 @@ { "summary": "Good work! \ud83c\udf1f Here are some general recommendations for improving your Python code.", - "comments": [ - { - "comment": "python.general.general_recommendations", - "params": {}, - "type": "informative" - } - ] + "comments": [] } \ No newline at end of file diff --git a/test/locomotive-engineer/analysis.json b/test/locomotive-engineer/analysis.json index 464bec9..7f28a1b 100644 --- a/test/locomotive-engineer/analysis.json +++ b/test/locomotive-engineer/analysis.json @@ -1,10 +1,4 @@ { "summary": "Good work! \ud83c\udf1f Here are some general recommendations for improving your Python code.", - "comments": [ - { - "comment": "python.general.general_recommendations", - "params": {}, - "type": "informative" - } - ] + "comments": [] } \ No newline at end of file diff --git a/test/tisbury-treasure-hunt/analysis.json b/test/tisbury-treasure-hunt/analysis.json index 464bec9..7f28a1b 100644 --- a/test/tisbury-treasure-hunt/analysis.json +++ b/test/tisbury-treasure-hunt/analysis.json @@ -1,10 +1,4 @@ { "summary": "Good work! \ud83c\udf1f Here are some general recommendations for improving your Python code.", - "comments": [ - { - "comment": "python.general.general_recommendations", - "params": {}, - "type": "informative" - } - ] + "comments": [] } \ No newline at end of file