Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e4cf565

Browse files
authored
Update AGENTS.md
1 parent 9e64953 commit e4cf565

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* If you're a security researcher, read @SECURITY.md carefully.
1+
22
* Brevity is good.
33
* Assume that the maintainers and readers of the code you write are Go experts:
44
* Don't use comments to explain the obvious.
@@ -8,9 +8,11 @@
88
* Never export symbols that's not needed outside of the package.
99
* Avoid global state at (almost) all cost.
1010
* This is a project with a long history; assume that a similiar problem has been solved before, look hard for helper functions before creating new ones.
11+
* In tests, almost always write end-to-end integration tests using `hugolib.Test` or one of its siblings. Write unit tests only for isolated utilities.
1112
* In tests, use `qt` matchers (e.g. `b.Assert(err, qt.ErrorMatches, ...)`) instead of raw `if`/`t.Fatal` checks.
1213
* In tests, always use the latest Hugo specification, e.g. for layouts, it's `layouts/page.html` and not `layouts/_default/single.html`, `layouts/list.html` and not `layouts/_default/list.html`
1314
* Never name tests `TestIssue1234`; if this e.g. is about fixing an issue, use the issue ID as a suffix, as in `TestUpperCaseTitlesCreatesHavocIssue1234`. And note: No underscores in func names.
15+
* If you're a security researcher, read @SECURITY.md carefully.
1416
* Brevity is good. This applies to code, comments and commit messages. Don't write a novel.
1517
* Use `./check.sh ./somepackage/...` when iterating.
1618
* Use `./check.sh` when you're done.

0 commit comments

Comments
 (0)