Repository navigation
Add code review standards: Copilot config, reviewer guide, and CI enforcement - #221
Conversation
Co-authored-by: lcn2 <10429707+lcn2@users.noreply.github.com>
|
I see a number of new files under .github. I have some additional requirements and refinements to the added files. Should I attempt to directly modify PR 221, or work with you in this chat, or work with the PR 221, or ??? |
lcn2
left a comment
There was a problem hiding this comment.
I have some additional requirements and refinements to the added files. Should I attempt to directly modify PR 221, or work with you in this chat, or work with the PR 221, or ???
Co-authored-by: lcn2 <10429707+lcn2@users.noreply.github.com>
Co-authored-by: lcn2 <10429707+lcn2@users.noreply.github.com>
lcn2
left a comment
There was a problem hiding this comment.
The Code Review Guide needs to be extended as follows:
- The code must be portable to the current versions of macOS, RHEL Linux, and NetBSD
- The
calccode must be CPU byte-order independent:make chkmust work on both Little Endian (Apple Silicon arm64, and x86_64), and Big Endian (s390x) hardware. - The documentation to be checked includes the files under the
help/directory: these must be included in the checks for typos and consistency. - The documentation to be checked also includes
BUSG,calc.man,CHANGES,CONTRIB-CODE,HOWTO.INSTALL,LIBRARY,README.FIRST,README.md,README.RELEASE,README.WINDOWS,sample.README,SECURITY.md. - The
./trailblankscript must run without error. - The
./trailblankscript must also ignore files under the.github/sub-directory. - The C code must conform to the format specified in
.clang-formatsuch that whenmake clang-formatis run, theclang-format(1)tool does not need to modify any files. - When a new version of calc is created, the
CHANGESfile must be updated with comments about the new version, including details of what changed. - The
cal/regress.calregression test suite must NOT assume that thecalcexecutable is in the local directory, and should not attempt to invoke thecalcexecutable.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new enforcement misses maintained sources, includes an ignored Copilot configuration, and can reject valid multiline comments.
Review effort: Balanced
Findings: 4
Open (5)
Move review guidance to a supported Copilot instruction file · New Handle multiline block comments when detecting added goto statements · New Include calc.man in the man-page typo check pathspec · New Do not exclude maintained lib_calc source files from review · New Include all .man sources in review instruction scope · New
What changed in this PR
Adds repository review standards, documentation, and CI enforcement for C control flow, testing, and spelling.
Changes:
- Adds Copilot and contributor review guidance.
- Adds PR workflows for tests, typo checks, and
gotodetection. - Configures typo exclusions and formatting-tool behavior.
| File | Description |
|---|---|
trailblank |
Excludes .github from picky phase 1. |
.github/workflows/typos.yml |
Checks changed files for typos. |
.github/workflows/tests.yml |
Builds and runs regression checks. |
.github/workflows/no-goto.yml |
Detects added goto statements. |
.github/instructions/docs.instructions.md |
Adds documentation review guidance. |
.github/instructions/comments.instructions.md |
Adds C-comment spelling guidance. |
.github/instructions/c-code.instructions.md |
Adds C review requirements. |
.github/copilot/code-review-instructions.md |
Adds review standards at an unsupported path. |
.github/copilot-instructions.md |
Defines repository-wide Copilot instructions. |
.github/CODE_REVIEW_GUIDE.md |
Documents standards and enforcement. |
_typos.toml |
Configures typo exclusions and vocabulary. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # Copilot code review standards for lcn2/calc | ||
|
|
||
| Apply these rules when reviewing pull requests. |
There was a problem hiding this comment.
Removed the unsupported duplicate instruction file and its guide reference in commit 02055f5.
| gsub(/\/\*.*\*\//, "", t) | ||
| sub(/\/\/.*/, "", t) | ||
| if (t ~ /^[ \t]*\*/ ) next | ||
| if (t ~ /(^|[^A-Za-z0-9_])goto([^A-Za-z0-9_]|$)/) { |
There was a problem hiding this comment.
Updated the workflow to scan full-file C lexical state before checking added lines, so multiline comments are ignored in commit 02055f5.
| run: | | ||
| files=$(git diff --name-only --diff-filter=ACMR \ | ||
| "origin/${{ github.base_ref }}...HEAD" -- \ | ||
| '*.c' '*.h' '*.md' '*.txt' '*.1' 'help/*' | tr '\n' ' ') |
There was a problem hiding this comment.
Added *.man to the changed-file pathspec in commit 02055f5.
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| applyTo: "**/*.md,**/*.txt,help/**" | |||
There was a problem hiding this comment.
Added **/*.man to the docs instruction scope in commit 02055f5.
lcn2
left a comment
There was a problem hiding this comment.
@copilot please update the Code Review Guide, copilot instructions, code review instructions to indicate that:
- The C code must conform clang-format options as found the
.clang-formatfile, such that whenmake clang-formatis run, the clang-format(1) tool does not need to modify any files.
Pease add workflows to ensure that the code confirms too clang-format options as found the .clang-format file, such that when make clang-format is run, the clang-format(1) tool does not need to modify any files.
Co-authored-by: lcn2 <10429707+lcn2@users.noreply.github.com>
Added the clang-format requirement to the review guidance and Copilot instructions, plus a PR workflow that runs |
Co-authored-by: lcn2 <10429707+lcn2@users.noreply.github.com>
lcn2
left a comment
There was a problem hiding this comment.
Please move the _typos.toml somewhere under the .github directory, if possible, or if not, rename it to .typos.toml so that the file is "hidden" for normal ls views.
Co-authored-by: lcn2 <10429707+lcn2@users.noreply.github.com>
Co-authored-by: lcn2 <10429707+lcn2@users.noreply.github.com>
Moved the config to |


Encodes three review standards for calc: no
gotoin C, tests must pass, and no typos in docs or code comments. They are written into Copilot code review config and a human-facing guide, and enforced by PR workflows. No C source is modified..github/copilot/code-review-instructions.mdholds the three standards..github/copilot-instructions.mdcarries the repo-wide rules..github/instructions/*.instructions.mdare path-scoped viaapplyTo:c-codeandcommentsapply to**/*.c,**/*.h;docsapplies to**/*.md,**/*.txt,help/**..github/CODE_REVIEW_GUIDE.md.github/workflows/): all trigger onpull_request(opened, synchronize, reopened) tomaster, withcontents: readandfetch-depth: 0.no-goto.ymlscans only added lines in*.c/*.hand strips strings and comments before matching. It printsfile:linefor each offender.tests.ymlinstalls the build dependencies, then runsmake clobber all,make check, andmake chk.typos.ymlrunscrate-ci/typos@v1on changed.c,.h,.md,.txt,.1, andhelp/*files only._typos.toml: excludes generated and vendored paths andcal/, and allows project terms.Review focus:
_typos.tomlexclusions and allow-list are a first guess. Expect to tune them against real runs.*.test.ymlalso runs on PRs, so builds run twice. Consider retiring it in favour oftests.yml.Follow-up (repo settings): mark these as required status checks in branch protection:
no-gototeststypos