-
Notifications
You must be signed in to change notification settings - Fork 15
Added a top-level Makefile in dotnet-sdk to simplify running tests and linters #149
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
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughA new Makefile is added at the repository root with targets for testing across multiple .NET framework versions (net48, net8.0, net9.0), linting, formatting, and a composite check target. The fmt target includes logic to temporarily modify target framework configurations, apply formatting, and restore original project files. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related issues
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
Makefile (1)
47-62: Minor: error handling in fmt target could be more defensive.The fmt target uses sed with
&&chaining to ensure both csproj files are modified before proceeding. However, if the sed command fails (e.g., due to an unexpected csproj format), the if statement will exit with an error code, but the Makefile will continue to execute the subsequentdotnet restoreanddotnet formatcommands. While this is unlikely to cause issues in practice, adding explicit error handling (e.g.,set -eor explicit checks) would make the target more robust to edge cases.Consider wrapping the sed commands in a check to exit early on failure:
- @if [ "$$(uname)" = "Darwin" ]; then \ - sed -i '' "..." src/OpenFga.Sdk/OpenFga.Sdk.csproj && \ - sed -i '' "..." src/OpenFga.Sdk.Test/OpenFga.Sdk.Test.csproj; \ - else \ - sed -i "..." src/OpenFga.Sdk/OpenFga.Sdk.csproj && \ - sed -i "..." src/OpenFga.Sdk.Test/OpenFga.Sdk.Test.csproj; \ - fi + @if [ "$$(uname)" = "Darwin" ]; then \ + sed -i '' "..." src/OpenFga.Sdk/OpenFga.Sdk.csproj && \ + sed -i '' "..." src/OpenFga.Sdk.Test/OpenFga.Sdk.Test.csproj || exit 1; \ + else \ + sed -i "..." src/OpenFga.Sdk/OpenFga.Sdk.csproj && \ + sed -i "..." src/OpenFga.Sdk.Test/OpenFga.Sdk.Test.csproj || exit 1; \ + fiThis ensures that if sed fails, the fmt target will halt before attempting to restore or format files.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Makefile(1 hunks)
🧰 Additional context used
🪛 checkmake (0.2.2)
Makefile
[warning] 4-4: Target body for "help" exceeds allowed length of 5 (8).
(maxbodylength)
[warning] 40-40: Target body for "fmt" exceeds allowed length of 5 (22).
(maxbodylength)
[warning] 1-1: Missing required phony target "all"
(minphony)
[warning] 1-1: Missing required phony target "clean"
(minphony)
Description
Added a standardized Makefile would make it much easier to test and lint the code locally with simple, consistent commands which would make it easy for contrubuters.
What problem is being solved?
How is it being solved?
What changes are made to solve it?
Added a Makefile to it
References
Closes #138
Review Checklist
mainSummary by CodeRabbit