-
Notifications
You must be signed in to change notification settings - Fork 22
Add AGENTS.md #1588
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
Open
elcritch
wants to merge
4
commits into
nim-lang:master
Choose a base branch
from
elcritch:add-agents-md
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add AGENTS.md #1588
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Repository Guidelines | ||
|
|
||
| ## Project Structure & Module Organization | ||
| - `src/` hosts compiler subsystems: `nimony/` (core pipeline), `nifc/` (IR + grammar), `hexer/` and `nifler/` (lexers), `hastur.nim`, and shared `lib/`. Keep related code together so incremental builds stay fast. | ||
| - `tests/` mirrors each subsystem with `.nif` fixtures plus `.expected.*` outputs; `tests/tester.nim` drives the diff-based checks. | ||
| - `doc/` contains specs (`design.md`, `language.md`, `nifc-spec.md`, `njvl-spec.md`), while `tools/` houses helper generators and `vendor/` holds pinned dependencies. | ||
|
|
||
| ## Build, Test, and Development Commands | ||
| - `nim c -r src/hastur build all` compiles every tool (nimony, nifc, hexer, nifler, nifmake, nj, VL) into `bin/`. | ||
| - `nim c -r src/hastur all` runs the full regression matrix; replace `all` with `nimony`, `nifc`, or another command to scope the suite. | ||
| - `nim c -r src/hastur test tests/nimony/tracked/foo.nim` targets a single file or directory, forwarding extra flags to the compiler. | ||
| - `nim c -r tests/tester` drives the fixture comparators (nifindexes, nifgram, hastur self-tests) and accepts `--overwrite` to refresh expected outputs. | ||
|
|
||
| ## Coding Style & Naming Conventions | ||
| - Stick to Nim’s two-space indentation, UTF-8 files, and `lower_snake_case` module names. Types stay `PascalCase`, procs `camelCase`, and exported symbols need a trailing `*`. | ||
| - Group imports (`import std / [syncio, parseopt]`), keep shared constants in `src/lib`, and compose features through the existing `gear2` helper modules instead of ad-hoc globals. | ||
| - `src/config.nims` enables `nimPreviewSlimSystem`, `--experimental:strictDefs`, and treats `Uninit`, `ProveInit`, and `StdPrefix` warnings as errors, so prefer explicit stdlib prefixes and exhaustive branches. | ||
elcritch marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Testing Guidelines | ||
| - Every behavioral change needs a regression under the matching `tests/` directory; use marker comments (`#[ ^errorId ]#`) so Hastur can assert diagnostic ranges. | ||
elcritch marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
elcritch marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - Refresh fixtures with `nim c -r src/hastur test <path> --overwrite` only when you fully understand the delta, because reviewers rely on `.expected` diffs. | ||
elcritch marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - Run `nim c -r src/hastur all` before pushing and call out skipped suites or flakes in the PR description. | ||
|
|
||
| ## Commit & Pull Request Guidelines | ||
| - Follow the existing log style: `fixes #1582; adjust VL range typing (#1583)` — imperative summary plus issue references, PR number optional. | ||
| - PRs should state motivation, identify touched subsystems, and list the exact test commands run; only add screenshots when visual proof is essential. | ||
| - Keep commits focused and separate refactors from behavioral patches so bisecting remains straightforward. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| AGENTS.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Nope, gear2 is dead except for its module name handling code.
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.
Is there an alternative or just go ad-hoc? I'd say just edit it and commit?
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.
New features typically are edits to
tags.mdthen runnim c -r tools/gen_tags, then the Nim compiler hints at the missing cases.