Skip to content
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

fixes #446: enhancements for code clarity and consistency #447

Closed
wants to merge 1 commit into from
Closed

fixes #446: enhancements for code clarity and consistency #447

wants to merge 1 commit into from

Conversation

Taehyun-Alex
Copy link

Fixes #446
Enhancements for code clarity and consistency.

  • I have added appropriate and informative messages to some try and except blocks in checker.py and util.py
  • I have added some docstrings to various Python files where I believed it could use detailed explanation of the function.
  • I have changed the variable names, 'message' and 'messages' to 'generated_message' and 'formatted_message'.

pass
except SyntaxError as syntax_error:
print(f"SyntaxError: {syntax_error}")
raise syntax_error
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both of these changes with SyntaxError should be reverted. This particular line (reraising the error instead of ignoring it) is a major change in behaviour that I don't think is desirable. I also don't think it's a good idea to print in either case, what's the reasoning?

@@ -60,6 +70,15 @@ def match_returns_stdout(func, solution):


def clean_result(result):
"""
Clean the result string for display
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm finding that a lot of these docstrings are not very helpful and a reader doesn't learn much from them that they couldn't guess from the function/argument names or see from a quick glance at the code. This is a strong example of that.

if entry["source"] == "shell":
return [], "shell"

messages = input_messages(runner.input_nodes)
generated_messages = input_messages(runner.input_nodes)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not finding this rename helpful.

@@ -118,7 +118,7 @@ def input_callback(_data=None):
print(f"<input: {result}>")
return result
else:
raise ValueError(t.Terms.no_more_test_inputs)
raise ValueError("No more test inputs available.")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The values in t.Terms change depending on the language.

@alexmojaki
Copy link
Owner

alexmojaki commented Dec 8, 2023

Many changes here (such as deleting service-worker.js) are definitely bad, and the rest are not clearly an improvement. Thank you for taking the time to contribute, but in future I recommend not making so many changes in a single PR in a project that you're not familiar with.

@alexmojaki alexmojaki closed this Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants