Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .snapperrc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# These files contain markup constructs that Snapper main does not yet preserve.
ignore = [
"CHANGELOG.rst",
"docs/source/differences-to-vws.rst",
"docs/source/unverified-behavior.rst",
]
3 changes: 2 additions & 1 deletion .vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ MinAlertLevel = error
Packages = https://github.com/tbhb/vale-ai-tells/releases/download/v1.29.0/ai-tells.zip

[*.{rst,md}]
BasedOnStyles = ai-tells
BasedOnStyles = ai-tells, snapper
snapper.SemanticLineBreaks = error

# These rules misclassify established technical, example, or release-note prose
# in this repository. All other ai-tells rules remain enforced.
Expand Down
3 changes: 1 addition & 2 deletions docs/source/ci-setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ Create environment variable files for secrets:
$ cp vuforia_secrets.env.example ci_secrets/vuforia_secrets_1.env
$ ...

Populate every variable listed in :file:`vuforia_secrets.env.example`.
Each file needs distinct active Cloud database credentials so concurrent jobs do not modify the same database.
Populate every variable listed in :file:`vuforia_secrets.env.example`. Each file needs distinct active Cloud database credentials so concurrent jobs do not modify the same database.
The files can share the inactive Cloud, active and inactive VuMark, and Model Target credentials.
Add at least as many consecutively numbered files, starting at zero, as there are builds in the GitHub test matrix.

Expand Down
9 changes: 3 additions & 6 deletions docs/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ Create an environment variable file for secrets:
$ cp vuforia_secrets.env.example vuforia_secrets.env

Some tests require Vuforia credentials.
To run these tests, add the Vuforia credentials to the file :file:`vuforia_secrets.env`.
See :ref:`connecting-to-vuforia`.
To run these tests, add the Vuforia credentials to the file :file:`vuforia_secrets.env`. See :ref:`connecting-to-vuforia`.

Then run ``pytest``:

Expand All @@ -73,14 +72,12 @@ Connecting to Vuforia
To connect to Vuforia, Vuforia target databases must be created via the Vuforia Web UI.
Then, secret keys must be set as environment variables.

The test infrastructure allows those keys to be set in the file :file:`vuforia_secrets.env`.
See :file:`vuforia_secrets.env.example` for the environment variables to set.
The test infrastructure allows those keys to be set in the file :file:`vuforia_secrets.env`. See :file:`vuforia_secrets.env.example` for the environment variables to set.

Do not use a target database that you are using for other purposes.
This is because the test suite adds and deletes targets.

To create a target database, first create a license key in the `Vuforia License Manager`_.
Then, add a database from the `Vuforia Target Manager`_.
To create a target database, first create a license key in the `Vuforia License Manager`_. Then, add a database from the `Vuforia Target Manager`_.

To find the environment variables to set in the :file:`vuforia_secrets.env` file, visit the Target Database in the `Vuforia Target Manager`_ and view the "Database Access Keys".

Expand Down
4 changes: 2 additions & 2 deletions docs/source/unreleased.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Unreleased changes
==================

Changes that have landed on the main branch but are not yet part of a
tagged release. These entries are assembled into the
Changes that have landed on the main branch but are not yet part of a tagged release.
These entries are assembled into the
:doc:`changelog` when the next release is published.

.. towncrier-draft-entries::
13 changes: 13 additions & 0 deletions prek.toml
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,19 @@ hooks = [
additional_dependencies = ["uv==0.11.7"],
stages = ["pre-commit"]
},
{
id = "snapper",
name = "snapper",
entry = "uv run --group=dev snapper --max-width 0 --in-place",
language = "python",
types_or = [
"rst",
"markdown"
],
require_serial = true,
additional_dependencies = ["uv==0.11.7"],
stages = ["pre-commit"]
},
{
id = "vale",
name = "vale",
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ dev = [
# use it to lint shell commands in GitHub workflow files.
"shellcheck-py==0.11.0.1",
"shfmt-py==4.1.0",
"snapper-fmt==0.11.0",
"sphinx==9.1.0",
"sphinx-copybutton==0.5.2",
"sphinx-lint==1.0.2",
Expand Down
11 changes: 11 additions & 0 deletions styles/snapper/LongProseLine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# Vale style rule: flag prose lines that are suspiciously long.
# Likely indicates wrapped text that should use semantic line breaks.
extends: existence
message: Prose line exceeds 120 characters. Consider running 'snapper' to break at
sentence boundaries.
level: suggestion
scope: paragraph
# This catches lines > 120 chars that contain a period followed by a space.
# Pure code or URLs are less likely to match.
tokens: ['.{120,}']
11 changes: 11 additions & 0 deletions styles/snapper/SemanticLineBreaks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# Vale style rule: flag lines containing multiple sentences.
# These should be broken at sentence boundaries.
extends: existence
message: Line contains multiple sentences. Run 'snapper --check' or reformat with
'snapper --in-place'.
level: warning
scope: paragraph
# Match a sentence-ending punctuation followed by a space and a capital letter
# on the same line (indicating two sentences on one line).
tokens: ['[.!?]\\s+[A-Z]']
15 changes: 15 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading