dotnet-sdk icon indicating copy to clipboard operation
dotnet-sdk copied to clipboard

Added a top-level Makefile in dotnet-sdk to simplify running tests and linters

Open Abishek-Newar opened this issue 2 months ago • 1 comments

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

  • [x] I have clicked on "allow edits by maintainers".
  • [ ] I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • [x] The correct base branch is being used, if not main
  • [x] I have added tests to validate that the change in functionality is working as expected

Summary by CodeRabbit

  • Chores
    • Added build automation scripts with commands for testing across multiple .NET framework versions, code formatting validation, and lint checks.

Abishek-Newar avatar Oct 30 '25 18:10 Abishek-Newar

[!IMPORTANT]

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

A 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

Cohort / File(s) Summary
New Makefile with CI/testing targets
Makefile
Adds help, test (runs net48/net8/net9 tests), test-net48/test-net8/test-net9 (framework-specific test targets), lint (verifies code formatting), fmt (temporarily modifies project files, applies formatting, and restores originals), and check (runs all checks). Includes platform-aware sed commands for macOS and other Unix variants.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Platform-specific sed syntax for macOS vs. Linux should be verified across common environments
  • Backup/restore logic in the fmt target should be tested for edge cases (e.g., interrupted execution)
  • Verify that hardcoded project file paths match the actual repository structure

Possibly related issues

  • sdk-generator#645: Similar Makefile implementation providing standardized CI targets across SDK repositories to streamline contributor workflows

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The pull request partially meets the requirements from issue #138, with a notable gap. The Makefile successfully implements the test target with support for all three frameworks (net48, net8.0, net9.0), the lint target for code formatting verification, and the fmt target with the required backup-and-restore mechanism for csproj files. However, according to the provided summary, the check target runs only lint and test, whereas issue #138 explicitly requires check to run all three targets in sequence: fmt, lint, and test. The missing fmt execution in the check target represents incomplete compliance with the stated requirements. Update the check target to execute fmt, lint, and test in sequence as specified in issue #138. The check target should be defined as .PHONY: check with check: fmt lint test to provide the complete workflow validation that contributors expect when running make check.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title accurately and clearly describes the primary change: adding a top-level Makefile to simplify running tests and linters. The title is concise, specific, and avoids vague terminology or unnecessary noise. A developer scanning through commit history would immediately understand the core purpose of this change.
Out of Scope Changes Check ✅ Passed All changes in this pull request are directly aligned with issue #138's requirements. The Makefile includes the four required phony targets (test, lint, fmt, check), implements the specified platform-aware sed commands for multi-target project handling, and includes reasonable enhancements like individual test framework targets (test-net48, test-net8, test-net9) and a help target that are consistent with standard Makefile practices and support the primary objectives.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Oct 30 '25 18:10 coderabbitai[bot]