Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/common/generic_analyzer/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions lib/currency-exchange/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions lib/ellens-alien-game/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions lib/ghost-gobble-arcade-game/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions lib/guidos-gorgeous-lasagna/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions lib/inventory-management/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions lib/little-sisters-essay/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions lib/little-sisters-vocab/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions lib/log-levels/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions lib/making-the-grade/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions lib/meltdown-mitigation/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions lib/pretty-leaflet/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions lib/processing-logs/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions lib/restaurant-rozalynn/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions lib/tisbury-treasure-hunt/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
8 changes: 1 addition & 7 deletions test/anagram/analysis.json
Original file line number Diff line number Diff line change
@@ -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": []
}
8 changes: 1 addition & 7 deletions test/currency-exchange/analysis.json
Original file line number Diff line number Diff line change
@@ -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": []
}
70 changes: 70 additions & 0 deletions test/dnd-character/analysis.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
8 changes: 1 addition & 7 deletions test/ellens-alien-game/analysis.json
Original file line number Diff line number Diff line change
@@ -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": []
}
8 changes: 1 addition & 7 deletions test/ghost-gobble-arcade-game/analysis.json
Original file line number Diff line number Diff line change
@@ -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": []
}
8 changes: 1 addition & 7 deletions test/inventory-management/analysis.json
Original file line number Diff line number Diff line change
@@ -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": []
}
8 changes: 1 addition & 7 deletions test/little-sisters-essay/analysis.json
Original file line number Diff line number Diff line change
@@ -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": []
}
8 changes: 1 addition & 7 deletions test/little-sisters-vocab/analysis.json
Original file line number Diff line number Diff line change
@@ -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": []
}
8 changes: 1 addition & 7 deletions test/locomotive-engineer/analysis.json
Original file line number Diff line number Diff line change
@@ -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": []
}
8 changes: 1 addition & 7 deletions test/tisbury-treasure-hunt/analysis.json
Original file line number Diff line number Diff line change
@@ -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": []
}