diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a71a37a..a43ac1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,7 @@ jobs: - uses: actions/checkout@v3 - run: | # Make Bash not silently ignore errors. - set -euo pipefail + set -euxo pipefail # Install the appropriate version of Rust. rustup toolchain install 1.76.0 # [ref:rust_1.76.0] diff --git a/README.md b/README.md index ef2a4be..75164a9 100644 --- a/README.md +++ b/README.md @@ -10,17 +10,19 @@ Tagref works with any programming language, and it respects your `.gitignore` fi ## What is it? -Tagref allows you to annotate your code with *tags* (in comments) which can be *referenced* from other parts of the codebase. For example, you might have a tag like this: +Tagref allows you to annotate your code with *tags* (in comments) which can be *referenced* from other parts of the codebase. For example, the following function has an important postcondition which is labeled with a tag: ```python -# [tag:cities_nonempty] There should be at least one city here. -cities = ['San Francisco', 'Tokyo'] +# [tag:polynomial_nonzero] This function never returns zero. +def polynomial(x): + return x ** 2 + 1 ``` -Elsewhere, suppose you're writing some code which depends on that fact. You can make that clear by referencing the tag: +Elsewhere (possibly in a different file), suppose you're writing some code which depends on that fact. You can make that clear by referencing the tag: ```python -first_city = cities[0] # This is safe due to [ref:cities_nonempty]. +def inverse_polynomial(x): + return 1 / polynomial(x) # This is safe due to [ref:polynomial_nonzero]. ``` To help you manage these tags and references, Tagref checks the following: