Skip to content
Closed
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
51 changes: 51 additions & 0 deletions markitdown_mcp/feedback_check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"""Module to verify PR feedback systems.

This file contains intentional issues to test the PR feedback workflow.
Testing the fixed Python indentation issue and static analysis fixes.
"""

import os

Check failure on line 7 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Code Issue Annotations

Ruff (F401)

markitdown_mcp/feedback_check.py:7:8: F401 `os` imported but unused

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'os' is not used.

Copilot Autofix

AI 9 months ago

To fix this problem, simply remove the unused import statement import os on line 7 of markitdown_mcp/feedback_check.py. This will eliminate the unnecessary dependency, clean up the import section, and make the codebase more maintainable. No other changes are needed because the os module is not referenced elsewhere in this file, and there are no indirect or hidden usages.

Suggested changeset 1
markitdown_mcp/feedback_check.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/markitdown_mcp/feedback_check.py b/markitdown_mcp/feedback_check.py
--- a/markitdown_mcp/feedback_check.py
+++ b/markitdown_mcp/feedback_check.py
@@ -4,7 +4,6 @@
 Testing the fixed Python indentation issue and static analysis fixes.
 """
 
-import os
 from typing import List
 import nonexistent_module  # This will trigger import error
 
EOF
@@ -4,7 +4,6 @@
Testing the fixed Python indentation issue and static analysis fixes.
"""

import os
from typing import List
import nonexistent_module # This will trigger import error

Copilot is powered by AI and may make mistakes. Always verify output.
from typing import List

Check failure on line 8 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Code Issue Annotations

Ruff (F401)

markitdown_mcp/feedback_check.py:8:20: F401 `typing.List` imported but unused

Check failure on line 8 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Code Issue Annotations

Ruff (UP035)

markitdown_mcp/feedback_check.py:8:1: UP035 `typing.List` is deprecated, use `list` instead

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'List' is not used.

Copilot Autofix

AI 9 months ago

The best way to fix the problem is to remove the unused import statement: from typing import List on line 8. This change will eliminate unnecessary dependencies and improve code readability. Only the specific line of the unused import should be removed; all other imports and code should remain unchanged.


Suggested changeset 1
markitdown_mcp/feedback_check.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/markitdown_mcp/feedback_check.py b/markitdown_mcp/feedback_check.py
--- a/markitdown_mcp/feedback_check.py
+++ b/markitdown_mcp/feedback_check.py
@@ -5,7 +5,6 @@
 """
 
 import os
-from typing import List
 import nonexistent_module  # This will trigger import error
 
 
EOF
@@ -5,7 +5,6 @@
"""

import os
from typing import List
import nonexistent_module # This will trigger import error


Copilot is powered by AI and may make mistakes. Always verify output.
import nonexistent_module # This will trigger import error

Check failure on line 9 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Code Issue Annotations

Ruff (F401)

markitdown_mcp/feedback_check.py:9:8: F401 `nonexistent_module` imported but unused

Check failure on line 9 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Code Issue Annotations

Ruff (I001)

markitdown_mcp/feedback_check.py:7:1: I001 Import block is un-sorted or un-formatted

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'nonexistent_module' is not used.

Copilot Autofix

AI 9 months ago

To fix the unused import, simply remove the line import nonexistent_module (line 9) from markitdown_mcp/feedback_check.py. This ensures the code does not attempt to import a non-existent module, avoids unnecessary dependencies, and makes the code easier to read and maintain. No other changes are required, as no functionality depends on this import.


Suggested changeset 1
markitdown_mcp/feedback_check.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/markitdown_mcp/feedback_check.py b/markitdown_mcp/feedback_check.py
--- a/markitdown_mcp/feedback_check.py
+++ b/markitdown_mcp/feedback_check.py
@@ -6,9 +6,9 @@
 
 import os
 from typing import List
-import nonexistent_module  # This will trigger import error
 
 
+
 def poorly_formatted_function(x,y,z):
     """Missing type hints and bad formatting."""
     if x == True:  # noqa - Should use 'is True'
EOF
@@ -6,9 +6,9 @@

import os
from typing import List
import nonexistent_module # This will trigger import error



def poorly_formatted_function(x,y,z):
"""Missing type hints and bad formatting."""
if x == True: # noqa - Should use 'is True'
Copilot is powered by AI and may make mistakes. Always verify output.


def poorly_formatted_function(x,y,z):
"""Missing type hints and bad formatting."""
if x == True: # noqa - Should use 'is True'
print(f"Value: {y}")

Check warning on line 15 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Code Issue Annotations

Debug print statement found: print(f"Value: {y}")
unused_variable = z * 2

Check failure on line 16 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Code Issue Annotations

Ruff (F841)

markitdown_mcp/feedback_check.py:16:9: F841 Local variable `unused_variable` is assigned to but never used
return x+y # Missing spaces around operator


class InconsistentNaming:
"""Class with naming issues."""

def __init__(self):
self.MyVariable = "should_be_lowercase"

def missing_docstring(self, param1):

Check notice on line 26 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Code Issue Annotations

Function "missing_docstring" missing docstring
return param1 * 2


# Potential security issue
HARDCODED_SECRET = "admin123"

Check notice on line 31 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Code Issue Annotations

[hardcoded_password_string] Possible hardcoded password: 'admin123'

Check failure on line 31 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Code Issue Annotations

Ruff (S105)

markitdown_mcp/feedback_check.py:31:20: S105 Possible hardcoded password assigned to: "HARDCODED_SECRET"
API_TOKEN = "sk-1234567890abcdef"

Check notice on line 32 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Code Issue Annotations

[hardcoded_password_string] Possible hardcoded password: 'sk-1234567890abcdef'

Check failure on line 32 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Code Issue Annotations

Ruff (S105)

markitdown_mcp/feedback_check.py:32:13: S105 Possible hardcoded password assigned to: "API_TOKEN"


def risky_eval_function(user_input):
"""Dangerous function using eval."""
# Security warning: eval is dangerous
result = eval(user_input) # noqa

Check failure on line 38 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Security Review Annotations

Dangerous eval/exec usage detected: result = eval(user_input) # noqa

Check warning on line 38 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Code Issue Annotations

[blacklist] Use of possibly insecure function - consider using safer ast.literal_eval.
return result

Check failure on line 39 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Code Issue Annotations

Ruff (RET504)

markitdown_mcp/feedback_check.py:39:12: RET504 Unnecessary assignment to `result` before `return` statement


def file_operation_without_error_handling():
"""Missing try/except block."""
with open("/etc/passwd") as f:

Check failure on line 44 in markitdown_mcp/feedback_check.py

View workflow job for this annotation

GitHub Actions / Code Issue Annotations

Ruff (PTH123)

markitdown_mcp/feedback_check.py:44:10: PTH123 `open()` should be replaced by `Path.open()`
content = f.read()
return content


def function_with_too_many_arguments(a, b, c, d, e, f, g, h):
"""Too many parameters."""
return a + b + c + d + e + f + g + h# Testing fixed PR feedback
Loading