feat(core): update formatting of agent rules documentation#33356
feat(core): update formatting of agent rules documentation#33356MaxKless merged 4 commits intonrwl:masterfrom
Conversation
|
| Name | Link |
|---|---|
| 🔨 Latest commit | 118cab2 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
I see what you mean... we decided for an h1 originally because then we can make sure that we're not messing with anyone's layout by nesting something where they don't want to. |
I'm on https://github.com/DavidAnson/markdownlint-cli2 (or rather the tooling around it) the rule is https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md025.md |
|
there are also spacing issues, currently it has two blank links before and after the snippet, which also triggers linters. so if we want to make it smarter it should
|
|
I now addressed that with an additional commit so it now dynamically adjusts spacing and header |
|
@MaxKless what do you think? |
|
Hey sorry this fell through the cracks - I like the solution more. |
Hah okay, so how do you want to proceed here? |
|
I think I'm okay with merging this if we add one more condition: the existing text has to have a Also, can you switch the implementation to be an object with options instead of adding a new option? I think this will become relevant in the future when we change some things around there in the codebase. Also rebase pls. Thanks! |
how does this look? |
|
View your CI Pipeline Execution ↗ for commit 928cc76
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Important
At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.
Nx Cloud has identified a possible root cause for your failed CI:
Our PR changes only affect agent rules documentation formatting (h1/h2 headers) in the nx package, while the failing tests are Gradle e2e tests in a completely different project. The failures are caused by an external service outage (foojay toolchain resolver returning 503 errors), not by our code changes. These tests should pass once the external service recovers.
No code changes were suggested for this issue.
You can trigger a rerun by pushing an empty commit:
git commit --allow-empty -m "chore: trigger rerun"
git push
🎓 Learn more about Self-Healing CI on nx.dev
👷 Deploy request for nx-dev pending review.Visit the deploys page to approve it
|
|
Addressed the review comments in b3e419b:
|
MaxKless
left a comment
There was a problem hiding this comment.
LGTM! Thanks for your patience and the fast feedback cycles on reviews/discussions :) appreciate your efforts
|
can you push your branch again after a rebase? I think there have been some changes to netflify config which caused this to hang @Stanzilla |
done! |
Markdown documents should only have one h1 header, it is pretty unlikely that an existing agents config does not already have one, switching to h2 instead should make most linters happy. In theory you could make this a little smarter by checking beforehand..
- Use h1 header for standalone files, h2 when appending to existing content - Fix spacing: single blank line before/after when appending - Remove leading/trailing whitespace from template - Addresses MD025 (single h1) markdown lint rule # Conflicts: # packages/nx/src/ai/set-up-ai-agents/get-agent-rules.ts
…ng h1 - Refactor getAgentRules and getAgentRulesWrapped to use options objects for better extensibility - Only use h2 header when appending if the existing file already has an h1 header, preventing unnecessary changes for trivial additions - Add test for appending to files without existing h1 header
- When updating existing nx block, check the rest of the document for an h1 instead of blindly preserving the existing header level - Correctly switches h1 to h2 if user adds their own h1 later - Added tests for h2 idempotency, h1-to-h2 switching, and run-twice scenarios
(cherry picked from commit 0b6961b)
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Markdown documents should only have one h1 header, it is pretty unlikely that an existing agents config does not already have one, switching to h2 instead should make most linters happy.
In theory you could make this a little smarter by checking beforehand..
I am also considering adding a line akin to
since mine keeps doing that. thoughts?
Current Behavior
The header is inserted as an h1
Expected Behavior
The header is inserted as an h2
Related Issue(s)
Fixes #