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

Add comments for the Java analyzer #2314

Merged
merged 2 commits into from
Jan 20, 2024
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
13 changes: 13 additions & 0 deletions analyzer-comments/java/general/avoid_print_statements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# avoid print statements

Try removing statements such as `System.out.println()` from your code.
Exercise tests require the solution to _return_ values from methods instead of printing them.

Usually, statements like these are added to help debug the code.
However, a better approach is to debug the code while running one or more unit tests.
This has the added advantage that one can focus on debugging a specific test case.

Here are some links that explain how to debug Java code while running unit tests in various IDEs:

- [Running and debugging Java tests in Visual Studio Code](https://code.visualstudio.com/docs/java/java-testing#_rundebug-test-cases)
- [Debugging tests in IntelliJ IDEA](https://www.jetbrains.com/help/idea/performing-tests.html#RedebugFailedTests)
13 changes: 13 additions & 0 deletions analyzer-comments/java/general/do_not_use_main_method.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# do not use main method

Try removing the `main` method from your code.
Exercise tests don't require solutions to have a `main` method and having one makes the code slightly harder to read.

Usually, a `main` method is added to help debug the code.
However, a better approach is to debug the code while running one or more unit tests.
This has the added advantage that one can focus on debugging a specific test case.

Here are some links that explain how to debug Java code while running unit tests in various IDEs:

- [Running and debugging Java tests in Visual Studio Code](https://code.visualstudio.com/docs/java/java-testing#_rundebug-test-cases)
- [Debugging tests in IntelliJ IDEA](https://www.jetbrains.com/help/idea/performing-tests.html#RedebugFailedTests)
5 changes: 5 additions & 0 deletions analyzer-comments/java/general/feedback_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# feedback request

If this automated feedback doesn't look right, please [open an issue in the `exercism/java-analyzer` repository][java-analyzer-issues].

[java-analyzer-issues]: https://github.com/exercism/java-analyzer/issues?q=is%%3Aissue+is%%3Aopen+sort%%3Aupdated-desc
Loading