Skip to content

Fix Makefile test rule#78

Merged
leynos merged 2 commits intomainfrom
codex/create-makefile-with-.phony-targets
Jun 21, 2025
Merged

Fix Makefile test rule#78
leynos merged 2 commits intomainfrom
codex/create-makefile-with-.phony-targets

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Jun 21, 2025

Summary

  • correct the fmt rule to run mdformat-all
  • mention make markdownlint in AGENTS.md
  • reflow README paragraph via mdformat

Testing

  • make fmt
  • make lint
  • make test
  • make nixie

https://chatgpt.com/codex/tasks/task_e_68560d14a0288322b06aefcb94cd90d6

Summary by Sourcery

Provide a Makefile to centralize environment setup and common development workflows, fix the formatting rule to include Mdformat, and update documentation to reference the new make targets and reflow a README paragraph.

Bug Fixes:

  • Correct the fmt Makefile target to run mdformat-all.

Enhancements:

  • Introduce a Makefile with targets for building, testing, formatting, linting, markdownlint, and Mermaid diagram validation.

Documentation:

  • Update AGENTS.md to reference make fmt, make markdownlint, make lint, and make nixie.
  • Reflow a paragraph in README.md using mdformat.

Summary by CodeRabbit

  • Chores
    • Updated development guidelines to standardise workflow using Makefile commands.
    • Introduced a Makefile with targets for building, testing, formatting, linting, and documentation checks.
  • Documentation
    • Minor formatting adjustment in the README for improved readability.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Jun 21, 2025

Reviewer's Guide

This PR centralizes formatting, linting, testing, and documentation validation into new Makefile targets, updates AGENTS.md and README.md to reference these make commands, and reflows the README paragraph via mdformat.

Class diagram for new Makefile targets

classDiagram
    class Makefile {
        +build()
        +test()
        +fmt()
        +build-support-run()
        +lint()
        +markdownlint()
        +nixie()
    }
    Makefile : build() -> cargo build
    Makefile : test() -> cargo test
    Makefile : fmt() -> cargo fmt, mdformat-all
    Makefile : lint() -> cargo clippy
    Makefile : markdownlint() -> markdownlint *.md **/*.md
    Makefile : nixie() -> nixie *.md **/*.md
Loading

File-Level Changes

Change Details Files
Updated documentation to use unified make targets
  • Replaced direct cargo fmt and clippy calls with make fmt, make markdownlint, and make lint
  • Changed Mermaid diagram validation to use make nixie
AGENTS.md
Reflowed README paragraph for consistent formatting
  • Adjusted line breaks in the final README paragraph via mdformat
README.md
Introduced a Makefile with standard project commands
  • Declared PHONY targets for build, test, fmt, lint, markdownlint, and nixie
  • Implemented fmt to run cargo fmt --all and mdformat-all
  • Added test, build-support-run, lint, markdownlint, and nixie targets with environment sourcing
Makefile

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 21, 2025

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

The project introduces a Makefile with standardised targets for building, testing, formatting, linting, and validating documentation. Corresponding updates in AGENTS.md instruct developers to use these Makefile targets instead of direct tool commands. README.md receives a minor formatting adjustment without altering content.

Changes

File(s) Change Summary
Makefile Added with targets for build, test, fmt, lint, markdownlint, nixie, and build-support-run.
AGENTS.md Updated development guidelines to use Makefile targets instead of direct Cargo or tool commands.
README.md Minor formatting fix to merge a split sentence into a single line.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Makefile
    participant Cargo
    participant Scripts
    participant LintTools

    Developer->>Makefile: make build / make test / make fmt / make lint / make markdownlint / make nixie
    Makefile->>Cargo: Runs build/test/fmt/lint commands (with env vars)
    Makefile->>LintTools: Runs markdownlint, mdformat-all, nixie as needed
    Makefile->>Scripts: Runs build_support_runner.sh (for build-support-run)
Loading

Possibly related PRs

Suggested reviewers

  • codescene-delta-analysis

Poem

In the warren, code hops in line,
With Makefile targets, things work just fine.
No more direct cargo calls to say,
Just “make test” and you’re on your way!
Docs and linting in one big leap—
A tidy codebase, promises to keep.
🐇✨

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch codex/create-makefile-with-.phony-targets

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @leynos - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a6a4a1d and f9f38f9.

📒 Files selected for processing (3)
  • AGENTS.md (2 hunks)
  • Makefile (1 hunks)
  • README.md (1 hunks)
🧰 Additional context used
🪛 checkmake (0.2.2)
Makefile

[warning] 1-1: Missing required phony target "all"

(minphony)


[warning] 1-1: Missing required phony target "clean"

(minphony)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-test
🔇 Additional comments (4)
Makefile (1)

14-15: Document mdformat-all requirement.

Ensure mdformat-all is listed as a prerequisite (e.g. in README or CONTRIBUTING) or installed via a dev dependency so make fmt succeeds consistently.

AGENTS.md (2)

7-8: Verify prerequisites for markdownlint.

The guideline now refers to make markdownlint. Please confirm that markdownlint-cli is noted as a dependency or preinstalled so this target reliably runs in all environments.


26-27: Approve addition of make nixie.

Validating Mermaid diagrams via make nixie aligns with the Makefile and enhances documentation checks.

README.md (1)

83-84: Approve reflowed documentation paragraph.

The merged sentence improves readability without altering meaning. Nice formatting adjustment.

Comment thread Makefile Outdated
@@ -0,0 +1,31 @@
.PHONY: build test fmt build-support-run lint markdownlint nixie
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Include standard phony targets.

Consider adding all (aliasing build) and a clean target to .PHONY for conventional Makefile support and repository cleanup.

Example:

.PHONY: all clean build test fmt ...
all: build
clean:
    cargo clean
🧰 Tools
🪛 checkmake (0.2.2)

[warning] 1-1: Missing required phony target "all"

(minphony)


[warning] 1-1: Missing required phony target "clean"

(minphony)

🤖 Prompt for AI Agents
In the Makefile at line 1, add the standard phony targets `all` and `clean` to
the `.PHONY` declaration. Define an `all` target that depends on `build` and a
`clean` target that runs `cargo clean` to support conventional Makefile usage
and enable repository cleanup.

Comment thread Makefile Outdated
Comment on lines +28 to +29
markdownlint *.md **/*.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Ensure markdownlint globbing works.

The **/*.md pattern may not expand in POSIX shells. Consider quoting the glob or using find:

markdownlint:
    find . -name '*.md' | xargs markdownlint
🤖 Prompt for AI Agents
In the Makefile around lines 28 to 29, the markdownlint command uses the glob
pattern '**/*.md' which may not expand correctly in POSIX shells. To fix this,
replace the glob pattern with a find command that searches for all '.md' files
recursively and pipes them to markdownlint using xargs. This ensures
compatibility across different shell environments.

Comment thread Makefile Outdated
Comment on lines +4 to +6
. ./.env
export DDLOG_HOME
RUSTFLAGS="-D warnings" cargo build
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Reduce duplication of environment setup.

The lines sourcing .env and exporting DDLOG_HOME repeat across targets. You can enable .ONESHELL or introduce a helper rule to consolidate this:

.ONESHELL:
ENV := . ./.env && export DDLOG_HOME

build test lint build-support-run:
    $(ENV)
    RUSTFLAGS="-D warnings" cargo $(@)

Also applies to: 9-11, 18-20, 23-25

🤖 Prompt for AI Agents
In the Makefile around lines 4 to 6, 9 to 11, 18 to 20, and 23 to 25, the
environment setup commands sourcing ./.env and exporting DDLOG_HOME are
duplicated across multiple targets. To fix this, enable the .ONESHELL directive
at the top of the Makefile and define a single environment setup variable or
helper rule that sources ./.env and exports DDLOG_HOME. Then, update the build,
test, lint, and build-support-run targets to use this shared environment setup
before running their respective cargo commands, reducing duplication and
improving maintainability.

Comment thread Makefile Outdated
Comment on lines +30 to +31
nixie:
nixie *.md **/*.md
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Ensure nixie globbing works.

Similarly, **/*.md might not be recognised by all shells. Use a find-based approach or quote the pattern to capture subdirectories reliably.

🤖 Prompt for AI Agents
In the Makefile at lines 30 to 31, the glob pattern `**/*.md` used in the nixie
target may not be recognized by all shells, causing it to miss markdown files in
subdirectories. Replace the glob pattern with a `find` command that searches
recursively for `.md` files or quote the pattern to ensure it is interpreted
correctly by the shell. This will make the nixie target reliably process all
markdown files in subdirectories.

@leynos leynos merged commit 71d28a9 into main Jun 21, 2025
5 checks passed
@leynos leynos deleted the codex/create-makefile-with-.phony-targets branch June 21, 2025 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant