Skip to content

style: enable compiler warnings and treat them as errors #5165

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 May 18, 2024

This PR enables the compiler warnings and treats them as errors. The goal is to remove all of the lines suppressing some of the warnings, i.e.

<arg>-Xlint:-auxiliaryclass</arg>
<arg>-Xlint:-rawtypes</arg>
<arg>-Xlint:-serial</arg>
<arg>-Xlint:-try</arg>
<arg>-Xlint:-unchecked</arg>

In case of Java 21 (#5163) two additional warnings needs to be suppressed (Java 17 does not know them):

<arg>-Xlint:-lossy-conversions</arg>
<arg>-Xlint:-this-escape</arg>

Similar to:

  • 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 38.58%. Comparing base (bf9d0ed) to head (46d804c).

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #5165   +/-   ##
=========================================
  Coverage     38.57%   38.58%           
- Complexity     2377     2379    +2     
=========================================
  Files           516      516           
  Lines         15315    15315           
  Branches       2957     2957           
=========================================
+ Hits           5908     5909    +1     
  Misses         9121     9121           
+ Partials        286      285    -1     

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

@vil02 vil02 marked this pull request as ready for review May 18, 2024 20:46
@BamaCharanChhandogi BamaCharanChhandogi merged commit d77d901 into TheAlgorithms:master May 19, 2024
4 checks passed
@vil02 vil02 deleted the enable_javac_warnings branch May 19, 2024 13:10
@vil02 vil02 mentioned this pull request Sep 20, 2024
6 tasks
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