Open roberth opened 4 months ago
Robert, I think I'd like to use the currently unused shebang at the top of these files for testing purposes, so that when you ran the file it'd run the tests for the file.
That's an interesting idea, but it is a bit less capable.
More subjectively, I also expect that bundling it with the other attributes makes it a nice, coherent experience that's similar to the package tests
and meta
attributes.
- The lines after are
s/^# / /
and parsed as yaml, until# ---
is encountered or a line that doesn't start with#
we should limit that to a very limited subset of yaml, like only lists of strings. Otherwise we might run into subtle differences between yaml 1.1 and 1.2 or some other less fun parsing things.
Is your feature request related to a problem? Please describe.
tests
attribute).Describe the solution you'd like
tests
attribute and such. Ameta
attribute for docs could be helpful, but out of scope for this discussion. I'm specifically trying to solve a problem for non-package files.Draft
Example:
## devspec
marks this as a standard header that must be parseable#
-style comment because it's about the implementation; not the interface, like documentation comments (/** */
)##
is a bit like the**
in/**
, marking that it's more significant somehow.devspec
is "grep-able", e.g. 6 or 7 keypresses while already editing the filedevspec
is searchable in issue tracker, documentation, etcs/^# / /
and parsed as yaml, until# ---
is encountered or a line that doesn't start with#
Then any tooling can use the info. Standard fields:
documentation
: list of paths and/or URLs that must be maintainedtests
: list of paths that have tests that check the current filetest-commands
: how to run the tests. This attribute can perhaps also be specified in thetests
files instead. These are meant to be Nix CLI compatible, but tooling is allowed to parse the commands. Test files should contain collections of tests that are fast enough, or taking thetest-commands
from thetests
files would be a problem. Factoring large suites into multiple files seems like a good idea anyway.maintainers
: people to ping, somewhat like CODEOWNERS, but controlled by us and without the mass ping problemAll paths are "relative URLs" (which include paths) that are resolved relative to the
base directory
, but/
refers to the root of the project (ie Nixpkgs) instead of the system root.Implementation steps:
test-commands
Add a :+1: reaction to issues you find important.