snapper-fmt 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. snapper_fmt-0.3.2/.github/workflows/ci.yml +29 -0
  2. snapper_fmt-0.3.2/.github/workflows/ci_docs.yml +34 -0
  3. snapper_fmt-0.3.2/.github/workflows/ci_prek.yml +62 -0
  4. snapper_fmt-0.3.2/.github/workflows/pypi.yml +102 -0
  5. snapper_fmt-0.3.2/.github/workflows/release.yml +343 -0
  6. snapper_fmt-0.3.2/.gitignore +24 -0
  7. snapper_fmt-0.3.2/.lychee.toml +16 -0
  8. snapper_fmt-0.3.2/.pre-commit-hooks.yaml +6 -0
  9. snapper_fmt-0.3.2/.typos.toml +17 -0
  10. snapper_fmt-0.3.2/CHANGELOG.md +94 -0
  11. snapper_fmt-0.3.2/CODEOWNERS +1 -0
  12. snapper_fmt-0.3.2/CODE_OF_CONDUCT.md +48 -0
  13. snapper_fmt-0.3.2/Cargo.lock +2856 -0
  14. snapper_fmt-0.3.2/Cargo.toml +56 -0
  15. snapper_fmt-0.3.2/LICENSE +21 -0
  16. snapper_fmt-0.3.2/PKG-INFO +308 -0
  17. snapper_fmt-0.3.2/README.md +285 -0
  18. snapper_fmt-0.3.2/action.yml +58 -0
  19. snapper_fmt-0.3.2/branding/logo/snapper_logo.png +0 -0
  20. snapper_fmt-0.3.2/cog.toml +25 -0
  21. snapper_fmt-0.3.2/dist-workspace.toml +15 -0
  22. snapper_fmt-0.3.2/docs/export.el +34 -0
  23. snapper_fmt-0.3.2/docs/locale/is/LC_MESSAGES/changelog.po +32 -0
  24. snapper_fmt-0.3.2/docs/locale/is/LC_MESSAGES/contributing/index.po +156 -0
  25. snapper_fmt-0.3.2/docs/locale/is/LC_MESSAGES/faq/index.po +284 -0
  26. snapper_fmt-0.3.2/docs/locale/is/LC_MESSAGES/howto/ci-enforcement.po +108 -0
  27. snapper_fmt-0.3.2/docs/locale/is/LC_MESSAGES/howto/editor-integration.po +141 -0
  28. snapper_fmt-0.3.2/docs/locale/is/LC_MESSAGES/howto/git-filter.po +98 -0
  29. snapper_fmt-0.3.2/docs/locale/is/LC_MESSAGES/howto/neural-detection.po +208 -0
  30. snapper_fmt-0.3.2/docs/locale/is/LC_MESSAGES/howto/pragmas.po +120 -0
  31. snapper_fmt-0.3.2/docs/locale/is/LC_MESSAGES/howto/vale-integration.po +118 -0
  32. snapper_fmt-0.3.2/docs/locale/is/LC_MESSAGES/index.po +54 -0
  33. snapper_fmt-0.3.2/docs/locale/is/LC_MESSAGES/reference/abbreviations.po +228 -0
  34. snapper_fmt-0.3.2/docs/locale/is/LC_MESSAGES/reference/cli.po +349 -0
  35. snapper_fmt-0.3.2/docs/locale/is/LC_MESSAGES/reference/config.po +156 -0
  36. snapper_fmt-0.3.2/docs/locale/is/LC_MESSAGES/reference/formats.po +282 -0
  37. snapper_fmt-0.3.2/docs/locale/is/LC_MESSAGES/tutorials/quickstart.po +222 -0
  38. snapper_fmt-0.3.2/docs/locale/pl/LC_MESSAGES/changelog.po +34 -0
  39. snapper_fmt-0.3.2/docs/locale/pl/LC_MESSAGES/contributing/index.po +156 -0
  40. snapper_fmt-0.3.2/docs/locale/pl/LC_MESSAGES/faq/index.po +285 -0
  41. snapper_fmt-0.3.2/docs/locale/pl/LC_MESSAGES/howto/ci-enforcement.po +110 -0
  42. snapper_fmt-0.3.2/docs/locale/pl/LC_MESSAGES/howto/editor-integration.po +141 -0
  43. snapper_fmt-0.3.2/docs/locale/pl/LC_MESSAGES/howto/git-filter.po +99 -0
  44. snapper_fmt-0.3.2/docs/locale/pl/LC_MESSAGES/howto/neural-detection.po +212 -0
  45. snapper_fmt-0.3.2/docs/locale/pl/LC_MESSAGES/howto/pragmas.po +122 -0
  46. snapper_fmt-0.3.2/docs/locale/pl/LC_MESSAGES/howto/vale-integration.po +119 -0
  47. snapper_fmt-0.3.2/docs/locale/pl/LC_MESSAGES/index.po +56 -0
  48. snapper_fmt-0.3.2/docs/locale/pl/LC_MESSAGES/reference/abbreviations.po +229 -0
  49. snapper_fmt-0.3.2/docs/locale/pl/LC_MESSAGES/reference/cli.po +355 -0
  50. snapper_fmt-0.3.2/docs/locale/pl/LC_MESSAGES/reference/config.po +160 -0
  51. snapper_fmt-0.3.2/docs/locale/pl/LC_MESSAGES/reference/formats.po +285 -0
  52. snapper_fmt-0.3.2/docs/locale/pl/LC_MESSAGES/tutorials/quickstart.po +224 -0
  53. snapper_fmt-0.3.2/docs/orgmode/changelog.org +6 -0
  54. snapper_fmt-0.3.2/docs/orgmode/contributing/index.org +109 -0
  55. snapper_fmt-0.3.2/docs/orgmode/faq/index.org +113 -0
  56. snapper_fmt-0.3.2/docs/orgmode/howto/ci-enforcement.org +92 -0
  57. snapper_fmt-0.3.2/docs/orgmode/howto/editor-integration.org +150 -0
  58. snapper_fmt-0.3.2/docs/orgmode/howto/git-filter.org +59 -0
  59. snapper_fmt-0.3.2/docs/orgmode/howto/neural-detection.org +74 -0
  60. snapper_fmt-0.3.2/docs/orgmode/howto/pragmas.org +83 -0
  61. snapper_fmt-0.3.2/docs/orgmode/howto/vale-integration.org +62 -0
  62. snapper_fmt-0.3.2/docs/orgmode/index.org +51 -0
  63. snapper_fmt-0.3.2/docs/orgmode/reference/abbreviations.org +90 -0
  64. snapper_fmt-0.3.2/docs/orgmode/reference/cli.org +154 -0
  65. snapper_fmt-0.3.2/docs/orgmode/reference/config.org +85 -0
  66. snapper_fmt-0.3.2/docs/orgmode/reference/formats.org +95 -0
  67. snapper_fmt-0.3.2/docs/orgmode/tutorials/quickstart.org +169 -0
  68. snapper_fmt-0.3.2/docs/source/_static/custom.css +37 -0
  69. snapper_fmt-0.3.2/docs/source/_static/favicon.ico +0 -0
  70. snapper_fmt-0.3.2/docs/source/_templates/partials/extra-head.html +15 -0
  71. snapper_fmt-0.3.2/docs/source/_templates/partials/site-foot.html +73 -0
  72. snapper_fmt-0.3.2/docs/source/conf.py +64 -0
  73. snapper_fmt-0.3.2/editors/vscode/icon.png +0 -0
  74. snapper_fmt-0.3.2/editors/vscode/package.json +56 -0
  75. snapper_fmt-0.3.2/editors/vscode/src/extension.ts +48 -0
  76. snapper_fmt-0.3.2/editors/vscode/tsconfig.json +12 -0
  77. snapper_fmt-0.3.2/examples/basic.txt +14 -0
  78. snapper_fmt-0.3.2/examples/paper.md +44 -0
  79. snapper_fmt-0.3.2/examples/paper.org +66 -0
  80. snapper_fmt-0.3.2/examples/paper.tex +49 -0
  81. snapper_fmt-0.3.2/flake.nix +44 -0
  82. snapper_fmt-0.3.2/pixi.lock +4339 -0
  83. snapper_fmt-0.3.2/pixi.toml +40 -0
  84. snapper_fmt-0.3.2/pyproject.toml +31 -0
  85. snapper_fmt-0.3.2/readme_src.org +154 -0
  86. snapper_fmt-0.3.2/scripts/build_i18n_docs.sh +28 -0
  87. snapper_fmt-0.3.2/scripts/org_to_md.sh +22 -0
  88. snapper_fmt-0.3.2/scripts/translate_po.py +247 -0
  89. snapper_fmt-0.3.2/site/apple-touch-icon.png +0 -0
  90. snapper_fmt-0.3.2/site/favicon.ico +0 -0
  91. snapper_fmt-0.3.2/site/index.html +1145 -0
  92. snapper_fmt-0.3.2/site/robots.txt +4 -0
  93. snapper_fmt-0.3.2/site/sitemap.xml +31 -0
  94. snapper_fmt-0.3.2/site/snapper_logo.png +0 -0
  95. snapper_fmt-0.3.2/src/abbreviations.rs +96 -0
  96. snapper_fmt-0.3.2/src/cli.rs +146 -0
  97. snapper_fmt-0.3.2/src/config.rs +165 -0
  98. snapper_fmt-0.3.2/src/diff.rs +70 -0
  99. snapper_fmt-0.3.2/src/files.rs +114 -0
  100. snapper_fmt-0.3.2/src/format.rs +35 -0
  101. snapper_fmt-0.3.2/src/git_diff.rs +110 -0
  102. snapper_fmt-0.3.2/src/init.rs +171 -0
  103. snapper_fmt-0.3.2/src/lib.rs +203 -0
  104. snapper_fmt-0.3.2/src/lsp.rs +230 -0
  105. snapper_fmt-0.3.2/src/main.rs +252 -0
  106. snapper_fmt-0.3.2/src/output.rs +74 -0
  107. snapper_fmt-0.3.2/src/parser/latex.rs +239 -0
  108. snapper_fmt-0.3.2/src/parser/markdown.rs +181 -0
  109. snapper_fmt-0.3.2/src/parser/mod.rs +82 -0
  110. snapper_fmt-0.3.2/src/parser/org.rs +307 -0
  111. snapper_fmt-0.3.2/src/parser/plaintext.rs +92 -0
  112. snapper_fmt-0.3.2/src/parser/rst.rs +244 -0
  113. snapper_fmt-0.3.2/src/reflow.rs +115 -0
  114. snapper_fmt-0.3.2/src/sdiff.rs +157 -0
  115. snapper_fmt-0.3.2/src/sentence/mod.rs +8 -0
  116. snapper_fmt-0.3.2/src/sentence/neural.rs +73 -0
  117. snapper_fmt-0.3.2/src/sentence/unicode.rs +310 -0
  118. snapper_fmt-0.3.2/src/watch.rs +147 -0
  119. snapper_fmt-0.3.2/tests/fixtures/expected.md +32 -0
  120. snapper_fmt-0.3.2/tests/fixtures/expected.org +45 -0
  121. snapper_fmt-0.3.2/tests/fixtures/expected.tex +35 -0
  122. snapper_fmt-0.3.2/tests/fixtures/expected.txt +12 -0
  123. snapper_fmt-0.3.2/tests/fixtures/sample.md +25 -0
  124. snapper_fmt-0.3.2/tests/fixtures/sample.org +36 -0
  125. snapper_fmt-0.3.2/tests/fixtures/sample.tex +28 -0
  126. snapper_fmt-0.3.2/tests/fixtures/sample.txt +5 -0
  127. snapper_fmt-0.3.2/tests/integration.rs +322 -0
  128. snapper_fmt-0.3.2/vale/snapper/LongProseLine.yml +10 -0
  129. snapper_fmt-0.3.2/vale/snapper/SemanticLineBreaks.yml +10 -0
@@ -0,0 +1,29 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ check:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ matrix:
14
+ os: [ubuntu-latest, macos-latest]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: dtolnay/rust-toolchain@stable
18
+ with:
19
+ components: rustfmt, clippy
20
+ - uses: Swatinem/rust-cache@v2
21
+
22
+ - name: Format check
23
+ run: cargo fmt --check
24
+
25
+ - name: Clippy
26
+ run: cargo clippy -- -D warnings
27
+
28
+ - name: Test
29
+ run: cargo test
@@ -0,0 +1,34 @@
1
+ name: Build and Deploy
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ tags: ["v*"]
7
+ pull_request:
8
+ branches: [main]
9
+
10
+ concurrency:
11
+ group: "pages"
12
+ cancel-in-progress: false
13
+
14
+ jobs:
15
+ build-deploy:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - uses: prefix-dev/setup-pixi@v0.9.4
21
+ with:
22
+ cache: true
23
+ environments: docs
24
+
25
+ - name: Build docs and assemble site
26
+ run: pixi run -e docs site-assemble
27
+
28
+ - name: Deploy to Cloudflare Pages
29
+ if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
30
+ uses: cloudflare/wrangler-action@v3
31
+ with:
32
+ apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
33
+ accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
34
+ command: pages deploy dist/ --project-name=snapper --branch=main
@@ -0,0 +1,62 @@
1
+ name: Pre-checks
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ schedule:
9
+ - cron: '0 6 1 * *'
10
+
11
+ concurrency:
12
+ group: prek-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ permissions: read-all
16
+
17
+ jobs:
18
+ lychee:
19
+ name: Link check
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+
24
+ - uses: lycheeverse/lychee-action@v2
25
+ with:
26
+ args: >-
27
+ --no-progress
28
+ --exclude-loopback
29
+ --exclude 'analytics.turtletech.us'
30
+ --exclude 'snapper-d8v.pages.dev'
31
+ '*.md'
32
+ '*.org'
33
+ 'docs/orgmode/**/*.org'
34
+ 'site/index.html'
35
+ fail: false
36
+
37
+ typos:
38
+ name: Spell check
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ - uses: crate-ci/typos@master
43
+ with:
44
+ config: .typos.toml
45
+
46
+ dogfood:
47
+ name: Snapper self-check
48
+ runs-on: ubuntu-latest
49
+ steps:
50
+ - uses: actions/checkout@v4
51
+ - uses: dtolnay/rust-toolchain@stable
52
+ - uses: Swatinem/rust-cache@v2
53
+
54
+ - name: Build snapper
55
+ run: cargo build --jobs 2
56
+
57
+ - name: Check docs formatting
58
+ run: |
59
+ cargo run --quiet -- --check --format org readme_src.org docs/orgmode/**/*.org examples/paper.org
60
+ cargo run --quiet -- --check --format plaintext examples/basic.txt
61
+ cargo run --quiet -- --check --format markdown examples/paper.md
62
+ cargo run --quiet -- --check --format latex examples/paper.tex
@@ -0,0 +1,102 @@
1
+ name: Python wheels
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ pull_request:
8
+ paths:
9
+ - 'src/**'
10
+ - 'Cargo.toml'
11
+ - 'Cargo.lock'
12
+ - 'pyproject.toml'
13
+ workflow_dispatch:
14
+
15
+ concurrency:
16
+ group: python-wheels-${{ github.ref }}
17
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
18
+
19
+ permissions:
20
+ contents: read
21
+
22
+ jobs:
23
+ sdist:
24
+ name: Build sdist
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+
29
+ - name: Build sdist
30
+ uses: PyO3/maturin-action@v1
31
+ with:
32
+ command: sdist
33
+ args: --out dist
34
+
35
+ - name: Validate sdist
36
+ run: pipx run twine check --strict dist/*
37
+
38
+ - uses: actions/upload-artifact@v4
39
+ with:
40
+ name: sdist
41
+ path: dist/*.tar.gz
42
+
43
+ wheels:
44
+ name: Build wheels (${{ matrix.os }}, ${{ matrix.target }})
45
+ runs-on: ${{ matrix.os }}
46
+ strategy:
47
+ fail-fast: false
48
+ matrix:
49
+ include:
50
+ - os: ubuntu-latest
51
+ target: x86_64
52
+ - os: ubuntu-22.04
53
+ target: aarch64
54
+ manylinux: 2_28
55
+ - os: macos-15
56
+ target: x86_64
57
+ - os: macos-14
58
+ target: aarch64
59
+ - os: windows-latest
60
+ target: x86_64
61
+ steps:
62
+ - uses: actions/checkout@v4
63
+
64
+ - uses: actions/setup-python@v5
65
+ with:
66
+ python-version: '3.12'
67
+
68
+ - name: Build wheels
69
+ uses: PyO3/maturin-action@v1
70
+ with:
71
+ target: ${{ matrix.target }}
72
+ args: --release --out dist --find-interpreter
73
+ manylinux: ${{ matrix.manylinux || 'auto' }}
74
+
75
+ - name: Validate wheels
76
+ if: matrix.target != 'aarch64' || runner.os != 'Linux'
77
+ run: pipx run twine check --strict dist/*
78
+
79
+ - uses: actions/upload-artifact@v4
80
+ with:
81
+ name: wheels-${{ matrix.os }}-${{ matrix.target }}
82
+ path: dist/*.whl
83
+
84
+ publish:
85
+ name: Publish to PyPI
86
+ needs: [sdist, wheels]
87
+ runs-on: ubuntu-latest
88
+ if: startsWith(github.ref, 'refs/tags/v')
89
+ environment:
90
+ name: pypi
91
+ url: https://pypi.org/p/snapper-fmt
92
+ permissions:
93
+ id-token: write
94
+ steps:
95
+ - uses: actions/download-artifact@v4
96
+ with:
97
+ pattern: '{sdist,wheels-*}'
98
+ merge-multiple: true
99
+ path: dist/
100
+
101
+ - name: Publish to PyPI
102
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,343 @@
1
+ # This file was autogenerated by dist: https://axodotdev.github.io/cargo-dist
2
+ #
3
+ # Copyright 2022-2024, axodotdev
4
+ # SPDX-License-Identifier: MIT or Apache-2.0
5
+ #
6
+ # CI that:
7
+ #
8
+ # * checks for a Git Tag that looks like a release
9
+ # * builds artifacts with dist (archives, installers, hashes)
10
+ # * uploads those artifacts to temporary workflow zip
11
+ # * on success, uploads the artifacts to a GitHub Release
12
+ #
13
+ # Note that the GitHub Release will be created with a generated
14
+ # title/body based on your changelogs.
15
+
16
+ name: Release
17
+ permissions:
18
+ "contents": "write"
19
+
20
+ # This task will run whenever you push a git tag that looks like a version
21
+ # like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc.
22
+ # Various formats will be parsed into a VERSION and an optional PACKAGE_NAME, where
23
+ # PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION
24
+ # must be a Cargo-style SemVer Version (must have at least major.minor.patch).
25
+ #
26
+ # If PACKAGE_NAME is specified, then the announcement will be for that
27
+ # package (erroring out if it doesn't have the given version or isn't dist-able).
28
+ #
29
+ # If PACKAGE_NAME isn't specified, then the announcement will be for all
30
+ # (dist-able) packages in the workspace with that version (this mode is
31
+ # intended for workspaces with only one dist-able package, or with all dist-able
32
+ # packages versioned/released in lockstep).
33
+ #
34
+ # If you push multiple tags at once, separate instances of this workflow will
35
+ # spin up, creating an independent announcement for each one. However, GitHub
36
+ # will hard limit this to 3 tags per commit, as it will assume more tags is a
37
+ # mistake.
38
+ #
39
+ # If there's a prerelease-style suffix to the version, then the release(s)
40
+ # will be marked as a prerelease.
41
+ on:
42
+ pull_request:
43
+ push:
44
+ tags:
45
+ - '**[0-9]+.[0-9]+.[0-9]+*'
46
+
47
+ jobs:
48
+ # Run 'dist plan' (or host) to determine what tasks we need to do
49
+ plan:
50
+ runs-on: "ubuntu-22.04"
51
+ outputs:
52
+ val: ${{ steps.plan.outputs.manifest }}
53
+ tag: ${{ !github.event.pull_request && github.ref_name || '' }}
54
+ tag-flag: ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }}
55
+ publishing: ${{ !github.event.pull_request }}
56
+ env:
57
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58
+ steps:
59
+ - uses: actions/checkout@v4
60
+ with:
61
+ persist-credentials: false
62
+ submodules: recursive
63
+ - name: Install dist
64
+ # we specify bash to get pipefail; it guards against the `curl` command
65
+ # failing. otherwise `sh` won't catch that `curl` returned non-0
66
+ shell: bash
67
+ run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.30.3/cargo-dist-installer.sh | sh"
68
+ - name: Cache dist
69
+ uses: actions/upload-artifact@v4
70
+ with:
71
+ name: cargo-dist-cache
72
+ path: ~/.cargo/bin/dist
73
+ # sure would be cool if github gave us proper conditionals...
74
+ # so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
75
+ # functionality based on whether this is a pull_request, and whether it's from a fork.
76
+ # (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
77
+ # but also really annoying to build CI around when it needs secrets to work right.)
78
+ - id: plan
79
+ run: |
80
+ dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
81
+ echo "dist ran successfully"
82
+ cat plan-dist-manifest.json
83
+ echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
84
+ - name: "Upload dist-manifest.json"
85
+ uses: actions/upload-artifact@v4
86
+ with:
87
+ name: artifacts-plan-dist-manifest
88
+ path: plan-dist-manifest.json
89
+
90
+ # Build and packages all the platform-specific things
91
+ build-local-artifacts:
92
+ name: build-local-artifacts (${{ join(matrix.targets, ', ') }})
93
+ # Let the initial task tell us to not run (currently very blunt)
94
+ needs:
95
+ - plan
96
+ if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
97
+ strategy:
98
+ fail-fast: false
99
+ # Target platforms/runners are computed by dist in create-release.
100
+ # Each member of the matrix has the following arguments:
101
+ #
102
+ # - runner: the github runner
103
+ # - dist-args: cli flags to pass to dist
104
+ # - install-dist: expression to run to install dist on the runner
105
+ #
106
+ # Typically there will be:
107
+ # - 1 "global" task that builds universal installers
108
+ # - N "local" tasks that build each platform's binaries and platform-specific installers
109
+ matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
110
+ runs-on: ${{ matrix.runner }}
111
+ container: ${{ matrix.container && matrix.container.image || null }}
112
+ env:
113
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114
+ BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
115
+ steps:
116
+ - name: enable windows longpaths
117
+ run: |
118
+ git config --global core.longpaths true
119
+ - uses: actions/checkout@v4
120
+ with:
121
+ persist-credentials: false
122
+ submodules: recursive
123
+ - name: Install Rust non-interactively if not already installed
124
+ if: ${{ matrix.container }}
125
+ run: |
126
+ if ! command -v cargo > /dev/null 2>&1; then
127
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
128
+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
129
+ fi
130
+ - name: Install dist
131
+ run: ${{ matrix.install_dist.run }}
132
+ # Get the dist-manifest
133
+ - name: Fetch local artifacts
134
+ uses: actions/download-artifact@v4
135
+ with:
136
+ pattern: artifacts-*
137
+ path: target/distrib/
138
+ merge-multiple: true
139
+ - name: Install dependencies
140
+ run: |
141
+ ${{ matrix.packages_install }}
142
+ - name: Build artifacts
143
+ run: |
144
+ # Actually do builds and make zips and whatnot
145
+ dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
146
+ echo "dist ran successfully"
147
+ - id: cargo-dist
148
+ name: Post-build
149
+ # We force bash here just because github makes it really hard to get values up
150
+ # to "real" actions without writing to env-vars, and writing to env-vars has
151
+ # inconsistent syntax between shell and powershell.
152
+ shell: bash
153
+ run: |
154
+ # Parse out what we just built and upload it to scratch storage
155
+ echo "paths<<EOF" >> "$GITHUB_OUTPUT"
156
+ dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
157
+ echo "EOF" >> "$GITHUB_OUTPUT"
158
+
159
+ cp dist-manifest.json "$BUILD_MANIFEST_NAME"
160
+ - name: "Upload artifacts"
161
+ uses: actions/upload-artifact@v4
162
+ with:
163
+ name: artifacts-build-local-${{ join(matrix.targets, '_') }}
164
+ path: |
165
+ ${{ steps.cargo-dist.outputs.paths }}
166
+ ${{ env.BUILD_MANIFEST_NAME }}
167
+
168
+ # Build and package all the platform-agnostic(ish) things
169
+ build-global-artifacts:
170
+ needs:
171
+ - plan
172
+ - build-local-artifacts
173
+ runs-on: "ubuntu-22.04"
174
+ env:
175
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
176
+ BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json
177
+ steps:
178
+ - uses: actions/checkout@v4
179
+ with:
180
+ persist-credentials: false
181
+ submodules: recursive
182
+ - name: Install cached dist
183
+ uses: actions/download-artifact@v4
184
+ with:
185
+ name: cargo-dist-cache
186
+ path: ~/.cargo/bin/
187
+ - run: chmod +x ~/.cargo/bin/dist
188
+ # Get all the local artifacts for the global tasks to use (for e.g. checksums)
189
+ - name: Fetch local artifacts
190
+ uses: actions/download-artifact@v4
191
+ with:
192
+ pattern: artifacts-*
193
+ path: target/distrib/
194
+ merge-multiple: true
195
+ - id: cargo-dist
196
+ shell: bash
197
+ run: |
198
+ dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
199
+ echo "dist ran successfully"
200
+
201
+ # Parse out what we just built and upload it to scratch storage
202
+ echo "paths<<EOF" >> "$GITHUB_OUTPUT"
203
+ jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
204
+ echo "EOF" >> "$GITHUB_OUTPUT"
205
+
206
+ cp dist-manifest.json "$BUILD_MANIFEST_NAME"
207
+ - name: "Upload artifacts"
208
+ uses: actions/upload-artifact@v4
209
+ with:
210
+ name: artifacts-build-global
211
+ path: |
212
+ ${{ steps.cargo-dist.outputs.paths }}
213
+ ${{ env.BUILD_MANIFEST_NAME }}
214
+ # Determines if we should publish/announce
215
+ host:
216
+ needs:
217
+ - plan
218
+ - build-local-artifacts
219
+ - build-global-artifacts
220
+ # Only run if we're "publishing", and only if plan, local and global didn't fail (skipped is fine)
221
+ if: ${{ always() && needs.plan.result == 'success' && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
222
+ env:
223
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
224
+ runs-on: "ubuntu-22.04"
225
+ outputs:
226
+ val: ${{ steps.host.outputs.manifest }}
227
+ steps:
228
+ - uses: actions/checkout@v4
229
+ with:
230
+ persist-credentials: false
231
+ submodules: recursive
232
+ - name: Install cached dist
233
+ uses: actions/download-artifact@v4
234
+ with:
235
+ name: cargo-dist-cache
236
+ path: ~/.cargo/bin/
237
+ - run: chmod +x ~/.cargo/bin/dist
238
+ # Fetch artifacts from scratch-storage
239
+ - name: Fetch artifacts
240
+ uses: actions/download-artifact@v4
241
+ with:
242
+ pattern: artifacts-*
243
+ path: target/distrib/
244
+ merge-multiple: true
245
+ - id: host
246
+ shell: bash
247
+ run: |
248
+ dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
249
+ echo "artifacts uploaded and released successfully"
250
+ cat dist-manifest.json
251
+ echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
252
+ - name: "Upload dist-manifest.json"
253
+ uses: actions/upload-artifact@v4
254
+ with:
255
+ # Overwrite the previous copy
256
+ name: artifacts-dist-manifest
257
+ path: dist-manifest.json
258
+ # Create a GitHub Release while uploading all files to it
259
+ - name: "Download GitHub Artifacts"
260
+ uses: actions/download-artifact@v4
261
+ with:
262
+ pattern: artifacts-*
263
+ path: artifacts
264
+ merge-multiple: true
265
+ - name: Cleanup
266
+ run: |
267
+ # Remove the granular manifests
268
+ rm -f artifacts/*-dist-manifest.json
269
+ - name: Create GitHub Release
270
+ env:
271
+ PRERELEASE_FLAG: "${{ fromJson(steps.host.outputs.manifest).announcement_is_prerelease && '--prerelease' || '' }}"
272
+ ANNOUNCEMENT_TITLE: "${{ fromJson(steps.host.outputs.manifest).announcement_title }}"
273
+ ANNOUNCEMENT_BODY: "${{ fromJson(steps.host.outputs.manifest).announcement_github_body }}"
274
+ RELEASE_COMMIT: "${{ github.sha }}"
275
+ run: |
276
+ # Write and read notes from a file to avoid quoting breaking things
277
+ echo "$ANNOUNCEMENT_BODY" > $RUNNER_TEMP/notes.txt
278
+
279
+ gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
280
+
281
+ publish-homebrew-formula:
282
+ needs:
283
+ - plan
284
+ - host
285
+ runs-on: "ubuntu-22.04"
286
+ env:
287
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
288
+ PLAN: ${{ needs.plan.outputs.val }}
289
+ GITHUB_USER: "axo bot"
290
+ GITHUB_EMAIL: "admin+bot@axo.dev"
291
+ if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
292
+ steps:
293
+ - uses: actions/checkout@v4
294
+ with:
295
+ persist-credentials: true
296
+ repository: "TurtleTech-ehf/homebrew-tap"
297
+ token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
298
+ # So we have access to the formula
299
+ - name: Fetch homebrew formulae
300
+ uses: actions/download-artifact@v4
301
+ with:
302
+ pattern: artifacts-*
303
+ path: Formula/
304
+ merge-multiple: true
305
+ # This is extra complex because you can make your Formula name not match your app name
306
+ # so we need to find releases with a *.rb file, and publish with that filename.
307
+ - name: Commit formula files
308
+ run: |
309
+ git config --global user.name "${GITHUB_USER}"
310
+ git config --global user.email "${GITHUB_EMAIL}"
311
+
312
+ for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith(".rb")] | any)'); do
313
+ filename=$(echo "$release" | jq '.artifacts[] | select(endswith(".rb"))' --raw-output)
314
+ name=$(echo "$filename" | sed "s/\.rb$//")
315
+ version=$(echo "$release" | jq .app_version --raw-output)
316
+
317
+ export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
318
+ brew update
319
+ # We avoid reformatting user-provided data such as the app description and homepage.
320
+ brew style --except-cops FormulaAudit/Homepage,FormulaAudit/Desc,FormulaAuditStrict --fix "Formula/${filename}" || true
321
+
322
+ git add "Formula/${filename}"
323
+ git commit -m "${name} ${version}"
324
+ done
325
+ git push
326
+
327
+ announce:
328
+ needs:
329
+ - plan
330
+ - host
331
+ - publish-homebrew-formula
332
+ # use "always() && ..." to allow us to wait for all publish jobs while
333
+ # still allowing individual publish jobs to skip themselves (for prereleases).
334
+ # "host" however must run to completion, no skipping allowed!
335
+ if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }}
336
+ runs-on: "ubuntu-22.04"
337
+ env:
338
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
339
+ steps:
340
+ - uses: actions/checkout@v4
341
+ with:
342
+ persist-credentials: false
343
+ submodules: recursive
@@ -0,0 +1,24 @@
1
+ /target
2
+
3
+ # Override global ignore for dotfiles we need tracked
4
+ !.pre-commit-hooks.yaml
5
+ !.github/
6
+ !.lychee.toml
7
+ !.typos.toml
8
+ *.swp
9
+ *.swo
10
+ *~
11
+ .direnv/
12
+ result
13
+ result-*
14
+ docs/.ox-rst/
15
+ docs/build/
16
+ docs/source/*.rst
17
+ docs/source/contributing/
18
+ docs/source/faq/
19
+ docs/source/howto/
20
+ docs/source/reference/
21
+ docs/source/tutorials/
22
+ docs/locale/pot/
23
+ docs/locale/**/*.mo
24
+ dist/
@@ -0,0 +1,16 @@
1
+ # lychee link checker config
2
+ # Run: lychee --config .lychee.toml .
3
+
4
+ exclude_loopback = true
5
+ max_concurrency = 16
6
+
7
+ # Exclude internal/analytics URLs
8
+ exclude = [
9
+ 'analytics.turtletech.us',
10
+ 'snapper-d8v.pages.dev',
11
+ 'localhost',
12
+ '127.0.0.1',
13
+ ]
14
+
15
+ # Include these file types
16
+ include_verbatim = true
@@ -0,0 +1,6 @@
1
+ - id: sembr
2
+ name: Semantic line breaks
3
+ description: Reformat prose files with semantic line breaks
4
+ entry: sembr --in-place
5
+ language: rust
6
+ types_or: [org, tex, markdown, plain-text]
@@ -0,0 +1,17 @@
1
+ [default.extend-words]
2
+ # Icelandic words that look like typos
3
+ bld = "bld"
4
+ tst = "tst"
5
+ maint = "maint"
6
+ # crate names
7
+ snapper-fmt = "snapper-fmt"
8
+
9
+ [files]
10
+ extend-exclude = [
11
+ "docs/locale/**/*.po",
12
+ "docs/build/**",
13
+ "Cargo.lock",
14
+ "pixi.lock",
15
+ "*.png",
16
+ "*.ico",
17
+ ]