Skip to content

Add AGENTS.md, a Makefile and lint checks in CI - #280

Merged
olaservo merged 4 commits into
mainfrom
chore/agents-md-makefile
Nov 3, 2026
Merged

olaservo merged 4 commits into
mainfrom
chore/agents-md-makefile

Conversation

@a-akimov

@a-akimov a-akimov commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

AGENTS.md sets out how to evolve the examples: keep them minimal, keep comments to a minimum, keep the five languages and the tutorials in sync, and run make check before a pull request.

The Makefile wraps the toolchain-native checks plus Ruff (ruff, tsc --noEmit, gofmt and go vet, rustfmt and clippy -D warnings, ruby -wc), rebuilds the compiled examples before the smoke tests so they never run stale binaries, and adds per-language targets. CI now runs make lint and make test.

The Rust examples did not pass rustfmt or clippy on main, so this also formats them and collapses one nested if.

How Has This Been Tested?

Locally

Breaking Changes

N/a

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Assisted by Claude Code

Copilot AI balanced review requested due to automatic review settings November 2, 2026 21:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Parallel checks can race npm installation and compilation, while Windows smoke tests can run stale Go binaries because rebuilds omit the executable suffix.

2 open issues
What changed in this PR

This PR standardizes contributor checks for the five-language MCP tutorial examples and documents how to keep examples and tutorials aligned.

Changes:

  • Adds contributor guidance and Makefile targets for linting, formatting, building, and smoke tests.
  • Updates CI to run lint checks and rebuild compiled examples before testing.
  • Formats Rust code and simplifies a nested conditional to satisfy the new checks.
File Description
weather-server-rust/​src/​main.rs Reorders imports for Rust formatting.
README.md Documents make check and links contributor guidance.
mcp-client-rust/​src/​main.rs Applies formatting and simplifies a nested conditional.
Makefile Adds shared and per-language check, format, and build targets.
AGENTS.md Defines minimal-example, synchronization, and contribution guidelines.
.github/​workflows/​ci.yml Installs Rust lint components and runs Makefile checks.

Review effort: Balanced

Comment thread Makefile Resolved
Comment thread Makefile Resolved
Copilot AI balanced review requested due to automatic review settings November 3, 2026 07:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The Makefile exits before printing captured Ruby syntax errors, leaving CI failures without the diagnostic needed to identify the problem.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Low severity Print captured Ruby syntax diagnostics before exiting

Makefile:98

When ruby -wc reports a syntax error, set -e exits at this assignment before echo runs. Since stderr is captured, the Ruby diagnostic is discarded and CI shows only Make's failure status, without the offending line or syntax error. Print the captured output on the failure path before exiting.

2 resolved since last review

Review effort: Balanced

@olaservo olaservo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

AGENTS.md, the Makefile and the CI change all look good, and I'd like to merge this. It needs a rebase first: #279 merged just now and removed the payload block in mcp-client-rust/src/main.rs that this PR reformats, so the branch conflicts with main on that file. After the rebase the if payload.is_empty() && let Some(...) hunk can be dropped, since that code no longer exists.

For what it's worth, I ran cargo fmt --check, cargo clippy --all-targets -- -D warnings, ruff check, ruff format --check, gofmt -l, go vet and ruby -wc on main with #278 and #279 merged. The only failures are the pre-existing rustfmt differences this PR already fixes (block_type, base_url, the println! in main, and the serde import order in the weather server), so once rebased make lint should be green.

One optional nit from Copilot's last pass: in lint-ruby, out=$$(ruby -wc $$f 2>&1) under set -e exits before the echo, so a syntax error would fail CI without printing Ruby's diagnostic. Something like out=$$(ruby -wc $$f 2>&1) || { echo "$$out"; exit 1; } keeps the message.


Generated by Claude Code

Copilot AI balanced review requested due to automatic review settings November 3, 2026 21:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the contributor guidance, local checks, and CI linting changes.

No open issues 🎉

Review effort: Balanced

a-akimov and others added 4 commits November 3, 2026 22:13
AGENTS.md sets out how to evolve the examples: keep them minimal,
keep comments to a minimum, keep the five languages and the tutorials
in sync, and run `make check` before a pull request. CLAUDE.md imports
it so Claude Code reads the same guidance.

The Makefile wraps the toolchain-native checks plus Ruff (ruff, tsc
--noEmit, gofmt and go vet, rustfmt and clippy -D warnings, ruby -wc),
rebuilds the compiled examples before the smoke tests so they never run
stale binaries, and adds per-language targets. CI now runs `make lint`
and `make test`.

The Rust examples did not pass rustfmt or clippy on main, so this also
formats them and collapses one nested `if`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NkL34oWhufSSqj9FbPx5dr
@a-akimov
a-akimov force-pushed the chore/agents-md-makefile branch from 759e21a to 4671a9f Compare November 3, 2026 21:15
Copilot AI balanced review requested due to automatic review settings November 3, 2026 21:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues for the contributor-guidance and shared validation changes.

No open issues 🎉

Review effort: Balanced

@olaservo olaservo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the rebase. The conflicting hunk is gone, the lint-ruby target now prints Ruby's diagnostic on a syntax error, and the new make lint and make test steps pass in CI on top of #278 and #279. Merging.


Generated by Claude Code

@olaservo
olaservo merged commit d65842e into main Nov 3, 2026
10 checks passed
@olaservo
olaservo deleted the chore/agents-md-makefile branch November 3, 2026 21:24
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