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

quokka::EOS code linting #578

Merged
merged 8 commits into from
Jun 10, 2024
Merged

Conversation

BenWibking
Copy link
Collaborator

@BenWibking BenWibking commented Mar 23, 2024

Description

This fixes some clang-tidy and CodeQL warnings for EOS.hpp. All of the changes convert pass-by-value to pass-by-reference for large objects in EOS function calls.

Related issues

https://github.com/quokka-astro/quokka/security/code-scanning/2609

Checklist

Before this pull request can be reviewed, all of these tasks should be completed. Denote completed tasks with an x inside the square brackets [ ] in the Markdown source below:

  • I have added a description (see above).
  • I have added a link to any related issues see (see above).
  • I have read the Contributing Guide.
  • I have added tests for any new physics that this PR adds to the code.
  • I have tested this PR on my local computer and all tests pass.
  • I have manually triggered the GPU tests with the magic comment /azp run.
  • I have requested a reviewer for this PR.

@BenWibking BenWibking requested a review from psharda March 23, 2024 17:11
@BenWibking
Copy link
Collaborator Author

/azp run

Copy link

Azure Pipelines successfully started running 5 pipeline(s).

@BenWibking BenWibking changed the title EOS.hpp code linting quokka::EOS code linting Mar 23, 2024
@BenWibking BenWibking marked this pull request as draft March 23, 2024 17:16
@BenWibking
Copy link
Collaborator Author

Oops, the change in function signature breaks some radiation test problems. I'll fix those.

@BenWibking
Copy link
Collaborator Author

/azp run

Copy link

Azure Pipelines successfully started running 5 pipeline(s).

@BenWibking
Copy link
Collaborator Author

/azp run

Copy link

Azure Pipelines successfully started running 5 pipeline(s).

@BenWibking BenWibking marked this pull request as ready for review March 23, 2024 18:12
@BenWibking
Copy link
Collaborator Author

BenWibking commented Mar 24, 2024

Apparently clang-tidy is confused. These warnings are all wrong. The parameter names are all already commented out.

{'DiagnosticName': 'misc-unused-parameters', 'DiagnosticMessage': {'Message': "parameter 'massScalars' is unused", 'FilePath': '/github/workspace/src/RadMarshak/test_radiation_marshak.cpp', 'FileOffset': 2943, 'Replacements': [{'FilePath': '/github/workspace/src/RadMarshak/test_radiation_marshak.cpp', 'Offset': 2943, 'Length': 1, 'ReplacementText': ' /*massScalars*/'}]}, 'Level': 'Warning', 'BuildDirectory': '/github/workspace/build/src/RadMarshak'}, 
{'DiagnosticName': 'misc-unused-parameters', 'DiagnosticMessage': {'Message': "parameter 'massScalars' is unused", 'FilePath': '/github/workspace/src/RadMarshak/test_radiation_marshak.cpp', 'FileOffset': 3240, 'Replacements': [{'FilePath': '/github/workspace/src/RadMarshak/test_radiation_marshak.cpp', 'Offset': 3240, 'Length': 1, 'ReplacementText': ' /*massScalars*/'}]}, 'Level': 'Warning', 'BuildDirectory': '/github/workspace/build/src/RadMarshak'}, 
{'DiagnosticName': 'misc-unused-parameters', 'DiagnosticMessage': {'Message': "parameter 'massScalars' is unused", 'FilePath': '/github/workspace/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp', 'FileOffset': 3194, 'Replacements': [{'FilePath': '/github/workspace/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp', 'Offset': 3194, 'Length': 1, 'ReplacementText': ' /*massScalars*/'}]}, 'Level': 'Warning', 'BuildDirectory': '/github/workspace/build/src/RadMarshakCGS'}, 
{'DiagnosticName': 'misc-unused-parameters', 'DiagnosticMessage': {'Message': "parameter 'massScalars' is unused", 'FilePath': '/github/workspace/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp', 'FileOffset': 3497, 'Replacements': [{'FilePath': '/github/workspace/src/RadMarshakCGS/test_radiation_marshak_cgs.cpp', 'Offset': 3497, 'Length': 1, 'ReplacementText': ' /*massScalars*/'}]}, 'Level': 'Warning', 'BuildDirectory': '/github/workspace/build/src/RadMarshakCGS'}, 
{'DiagnosticName': 'misc-unused-parameters', 'DiagnosticMessage': {'Message': "parameter 'massScalars' is unused", 'FilePath': '/github/workspace/src/RadMatterCoupling/test_radiation_matter_coupling.cpp', 'FileOffset': 2958, 'Replacements': [{'FilePath': '/github/workspace/src/RadMatterCoupling/test_radiation_matter_coupling.cpp', 'Offset': 2958, 'Length': 1, 'ReplacementText': ' /*massScalars*/'}]}, 'Level': 'Warning', 'BuildDirectory': '/github/workspace/build/src/RadMatterCoupling'}, 
{'DiagnosticName': 'misc-unused-parameters', 'DiagnosticMessage': {'Message': "parameter 'massScalars' is unused", 'FilePath': '/github/workspace/src/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp', 'FileOffset': 3055, 'Replacements': [{'FilePath': '/github/workspace/src/RadMatterCouplingRSLA/test_radiation_matter_coupling_rsla.cpp', 'Offset': 3055, 'Length': 1, 'ReplacementText': ' /*massScalars*/'}]}, 'Level': 'Warning', 'BuildDirectory': '/github/workspace/build/src/RadMatterCouplingRSLA'}, 
{'DiagnosticName': 'misc-unused-parameters', 'DiagnosticMessage': {'Message': "parameter 'massScalars' is unused", 'FilePath': '/github/workspace/src/RadSuOlson/test_radiation_SuOlson.cpp', 'FileOffset': 3334, 'Replacements': [{'FilePath': '/github/workspace/src/RadSuOlson/test_radiation_SuOlson.cpp', 'Offset': 3334, 'Length': 1, 'ReplacementText': ' /*massScalars*/'}]}, 'Level': 'Warning', 'BuildDirectory': '/github/workspace/build/src/RadSuOlson'}, 
{'DiagnosticName': 'misc-unused-parameters', 'DiagnosticMessage': {'Message': "parameter 'massScalars' is unused", 'FilePath': '/github/workspace/src/RadSuOlson/test_radiation_SuOlson.cpp', 'FileOffset': 3631, 'Replacements': [{'FilePath': '/github/workspace/src/RadSuOlson/test_radiation_SuOlson.cpp', 'Offset': 3631, 'Length': 1, 'ReplacementText': ' /*massScalars*/'}]}, 'Level': 'Warning', 'BuildDirectory': '/github/workspace/build/src/RadSuOlson'}, 
{'DiagnosticName': 'misc-unused-parameters', 'DiagnosticMessage': {'Message': "parameter 'massScalars' is unused", 'FilePath': '/github/workspace/src/RadTophat/test_radiation_tophat.cpp', 'FileOffset': 3817, 'Replacements': [{'FilePath': '/github/workspace/src/RadTophat/test_radiation_tophat.cpp', 'Offset': 3817, 'Length': 1, 'ReplacementText': ' /*massScalars*/'}]}, 'Level': 'Warning', 'BuildDirectory': '/github/workspace/build/src/RadTophat'}]}

@BenWibking
Copy link
Collaborator Author

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@BenWibking BenWibking requested a review from markkrumholz June 7, 2024 22:30
@BenWibking BenWibking enabled auto-merge June 8, 2024 15:54
@BenWibking
Copy link
Collaborator Author

@markkrumholz @psharda would either of you be able to review this? It should be very straightforward.

@markkrumholz
Copy link
Collaborator

@markkrumholz @psharda would either of you be able to review this? It should be very straightforward.

Will look tomorrow. Today is a holiday in Australia, and I have family in town.

@BenWibking BenWibking added this pull request to the merge queue Jun 10, 2024
Merged via the queue into development with commit c52d071 Jun 10, 2024
21 checks passed
@BenWibking BenWibking deleted the BenWibking/fix-unused-clang-tidy branch July 31, 2024 15:45
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