summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-01-06 16:22:23 -0500
committerBen Sima <ben@bsima.me>2025-01-06 16:22:23 -0500
commitd2edf150cf2c876971383a4a484f289ce7e7f680 (patch)
tree1cd30c0efe2afa2f0d1ca935738fac22d5687659 /README.md
parentd9fb7a85c920c9332fba34087fe8527d140b65f0 (diff)
Remove Python main idiom and add coding conventions to README.md
I realized I don't need this stupid `__main__` convention anymore because my build system always calls Python programs like `python -m main`, so I just need to have a function named `main()`. I also started adding some general coding conventions to the README and fixed a typo.
Diffstat (limited to 'README.md')
-rw-r--r--README.md15
1 files changed, 14 insertions, 1 deletions
diff --git a/README.md b/README.md
index 142c07a..f7756df 100644
--- a/README.md
+++ b/README.md
@@ -90,7 +90,7 @@ this command to run tests for a namespace.
is our cloud VM instance. The `--time 0` argument disables the timeout (which
defaults to 10 minutes), this is useful for longer builds.
-`bild --json Omni/Test.hs` this just does the analysis step, and prints a
+`bild --plan Omni/Test.hs` this just does the analysis step, and prints a
description of the build as JSON. It will not build anything.
### lint
@@ -120,6 +120,19 @@ loaded.
`repl.sh --bash Omni/Log.py` this creates a nix shell for `Omni/Log.py`, but
starts a bash shell for the namespace instead of a Python repl.
+## Coding Conventions
+
+There are some conventions we use for every program, across every language in
+use.
+
+1. At the command line interface, the program must take `test` as a first
+ argument, which will run the program's test suite. This is used as a standard
+ interface for running tests in CI.
+2. The entrypoint for every program shall be called `main.` In Python, the
+ convention `if __name__ == "__main__"` is not necessary because `bild` wraps
+ the program in a call like `python -m main`; the same is true of Guile
+ scheme.
+
## Setting up remote builds
The `Omni.Dev` machine acts as a remote build server and Nix cache. To use it from