Skip to content

chore: configure PMD to detect main methods #6289

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

Merged

Conversation

vil02
Copy link
Member

@vil02 vil02 commented Jun 11, 2025

This PR makes the CI to fail when a main method is detected.

Changes by file:

  • pom.xml - adds the custom ruleset to the current PMD config,
  • pmd-custom_ruleset.xml - defines the new rule UselessMainMethod - it makes PMD to fail on any occurrence of any main method,
  • pmd-exclude.properties - some of the existing class already define main method, the changes in this file suppress the corresponding errors.
  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.07%. Comparing base (e41c2b9) to head (700bdb8).

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #6289   +/-   ##
=========================================
  Coverage     74.06%   74.07%           
- Complexity     5350     5351    +1     
=========================================
  Files           677      677           
  Lines         18648    18648           
  Branches       3621     3621           
=========================================
+ Hits          13812    13813    +1     
  Misses         4276     4276           
+ Partials        560      559    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vil02 vil02 marked this pull request as ready for review June 11, 2025 13:46
Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

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

Nice!

@siriak siriak merged commit 20f0492 into TheAlgorithms:master Jun 11, 2025
5 checks passed
@vil02 vil02 deleted the configure_pmd_to_detect_main_methods branch June 11, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants