Repository navigation
Releases
Releases · kpozin/sprawl-guard
sprawl-guard v0.7.0
Immutable
release. Only release title and notes can be modified.
Changed
file_sizesin the ratchet file is now a table keyed by path, such as"assets/hero.png" = 2000000. A file in Git LFS has{ max_bytes = 50000000, storage = "lfs" }. Ratchet files from 0.6.0 still work, and the nextupdate --writeortighten --writerewrites them. Sprawl Guard 0.6.0 can't read a rewritten file, so upgrade every copy that checks the repository, including CI, before you commit it. If a file moved into or out of Git LFS, 0.6.0 may have recorded two ceilings for it, which this release rejects: delete the entry whosestoragethe file no longer uses.- JSON output reports a file that isn't in Git LFS with
"storage": "regular"instead of"git".
sprawl-guard v0.6.0
Immutable
release. Only release title and notes can be modified.
This release adds byte limits on file sizes and publishes Sprawl Guard on PyPI. Before upgrading, check your configuration globs: * no longer crosses directories.
Added
[limits].max_bytes_per_filelimits the size of every file thatcheckvisits, source or not, such as images and archives.[limits].max_bytes_per_lfs_objectlimits files that.gitattributesassigns to Git LFS instead, at their full size whether or not Git LFS has downloaded them. Both are unlimited by default, accept a size with a unit, such as"10 MB"or"1.5 GiB", and can be set in[[overrides]].- Files over a limit are reported in every output format, as
file_bytesandlfs_object_bytesviolations in JSON output. - The ratchet file's new
[[file_sizes]]table records the accepted size of a file over its limit.updateadds entries andtightenlowers or removes them. Sprawl Guard 0.5 and earlier can't read a ratchet file with this table, so upgrade every copy that checks the repository together. explainreports a file's size, its byte limit, and the overrides that set the limit.checkdoesn't count the lines of a source file that is a Git LFS pointer, and reports it as a warning instead.
- Files over a limit are reported in every output format, as
- Sprawl Guard is on PyPI as
sprawl-guard, so Python projects can install it with uv, pip, or pipx and pin it in their lockfile. checklists at most 50 findings in human and GitHub output, so a large first run keeps its summary on screen. Change the cap with--max-findings <N|unlimited>or[output].max_findings. The exit status still reflects every violation, and JSON and SARIF output list every finding.checkwarns when it skips a path given on the command line because the path is hidden or ignored.
Changed
- In configuration globs,
*and?no longer match/.src/*.rsmatchedsrc/a/b.rsbefore and now matches only files directly insrc. Use**to cross directories: writevendor/**wherevendor/*was meant to cover a whole tree, and**/*.generated.tswhere*.generated.tswas meant to match at any depth.**crosses directories only as a whole path component, so writesrc/**/*.rswheresrc/**.rswas used. The bundled patterns already use**. checkno longer stops at the first file it can't analyze, such as a source file too large to count or one it can't read. It reports every such gap along with every violation. Under[traversal].unreadable_paths = "fail", gaps makecheckexit2; under"warn", they are warnings. In JSON output,statusiserrorin that case,coveragelists the gaps, and theerrorobject is gone.[traversal].max_file_bytesis now[traversal].max_parsed_code_file_bytes. The old name still loads;sprawl-guard config upgrade --writerenames it.- Human output headings show their group's total, as in
Files over the line limit (3):.
Fixed
checkwith a file path no longer passes a directory over its direct-file limit, or reports its ratchet entry as stale, because only some of its files were selected.- Rust test-code exclusion no longer miscounts a file when non-ASCII text precedes the end of an excluded item on the same line.
- A Rust file that starts with a byte order mark counts the same as one without it.
- A configuration that sets one language under two spellings, such as
[languages.rust]and[languages.Rust], is rejected. Before, one of the two tables was dropped without a message. - Configuration errors for a zero or negative count name the rule it breaks instead of an internal type.
- With
[ignore].skip_hidden = false, the scan now leaves out.git. - SARIF output gives valid file locations for paths with spaces or special characters, and for repositories checked with
--rootinside a GitHub Actions workspace. - The npm package runs on older Linux releases, such as Red Hat Enterprise Linux 9, by falling back to its WebAssembly build. Before, it failed to start there.
- The npm package's WebAssembly build places GitHub annotations and SARIF paths in the workspace as the native builds do.
sprawl-guard v0.6.0-beta.3
Immutable
release. Only release title and notes can be modified.
Added
[limits].max_bytes_per_lfs_objectlimits the content size of files that.gitattributesassigns to Git LFS withfilter=lfs: the size a pointer declares when Git LFS hasn't downloaded the file, and the size on disk when it has, so results match either way unless a Git LFS extension transforms the file. It is unlimited by default, accepts a size with a unit, and is available in[[overrides]]. Human output lists these files underGit LFS objects over the byte limit. JSON output reports them aslfs_object_bytesviolations, SARIF output under thesprawl-guard/lfs-object-bytesrule, and GitHub output as annotations on the file.explainreports the file'sstorage, and fails when a.gitattributesthat decides it can't be read.checkreads.gitattributesin the root, its subdirectories, and the directories above it up to the top of the Git work tree, and reports one it can't read as aread_git_attributes_failedgap covering its directory.
Changed
[limits].max_bytes_per_filelimits only files that Git stores. Files that.gitattributesassigns to Git LFS are exempt from it, so assets moved to Git LFS on purpose are no longer flagged.[[file_sizes]]ratchet entries require the file'sstorage:gitorlfs. Stale Git LFS entries are reported aslfs_object_bytes_stale. A ratchet file from 0.6.0-beta.2 with[[file_sizes]]entries no longer loads. Back it up, delete those entries, and runupdate.updaterecords current sizes rather than the old ceilings, so review the new byte ceilings before committing them.checkfinds Git LFS files through.gitattributesinstead of by reading every small file, so a small file that Git stores and that can't be opened is no longer reported as an unreadable path. A Git LFS pointer that.gitattributesdoesn't assign to Git LFS is measured at its size on disk.- In configuration globs,
*and?no longer match/.src/*.rsmatchedsrc/a/b.rsbefore and now matches only files directly insrc. Use**to cross directories: writevendor/**wherevendor/*was meant to cover a whole tree, and**/*.generated.tswhere*.generated.tswas meant to match at any depth.**crosses directories only as a whole path component, so writesrc/**/*.rswheresrc/**.rswas used. The bundled patterns already use**.
Removed
- JSON output no longer reports
measured_fromandpointer_bytesfor file sizes.
Fixed
checkwith a file path no longer judges that file's directory by a count of the selected files alone. Before, a directory over its direct-file limit passed, and a directory with a ratchet entry was reported stale. A directory's direct files are now checked only when the directory itself is selected.- Rust
cfg(test)exclusion removes exactly the excluded item when non-ASCII text precedes the item's end on the same line. Before, leftover bytes could turn the rest of the file into one string literal and miscount it. - A production Rust file that starts with a UTF-8 byte order mark counts the same as one without it.
- A zero or negative
max_direct_files_per_directoryor[output].max_findingsis rejected with the rule it breaks, such asdirect-file count must be greater than zero. Before, the error named an internal type. - A configuration that sets one language under two spellings, such as
[languages.rust]and[languages.Rust], is rejected. Before, one of the two tables was dropped without a message. checkwarns when the scan skips a path given on the command line because the path is hidden or an ignore file excludes it. Before,check .github/script.pypassed without checking the file and without saying so. JSON output reports aselected_path_skippedwarning, and SARIF output a warning notification.- With
[ignore].skip_hidden = false, the scan leaves out.git. Before, it checked Git's own objects against byte limits and counted them towardtraversal.max_entries. - SARIF output percent-encodes file paths, so a path with a space,
#or%is a valid URI. WhenGITHUB_WORKSPACEis set and the root is inside it, each path starts with the root's place in the workspace, as--format githubpaths do, so code scanning finds files checked with--root. When the root is outside the workspace, or the workspace does not exist, results carry no file location, as GitHub annotations already did. A result about a directory no longer names line 1. - The npm package runs its WebAssembly build on Linux with glibc older than 2.35. Before, it started the native binary, which failed to load with
version 'GLIBC_2.35' not found. - The npm package's WebAssembly build reads
GITHUB_WORKSPACE, so--format githubannotations and SARIF paths include the root's place in the workspace, as the native builds do.
sprawl-guard v0.6.0-beta.2
Immutable
release. Only release title and notes can be modified.
Added
checklists at most 50 findings in human and GitHub output, so a large first run keeps its summary on screen. Set the cap with--max-findings <N|unlimited>or[output].max_findings. Analysis gaps that fail the check take the listed slots first, then violations, then warnings. Group headings show their totals, a group cut short ends with… and N more, and a footer gives how many findings were shown out of the total. The cap also bounds the files a directory finding names. GitHub annotations cover only the listed findings. The exit status still reflects every violation, and JSON and SARIF output list every finding.[limits].max_bytes_per_filelimits the size of every file thatcheckvisits, source or not, such as images and archives. It is unlimited by default, and[[overrides]]can set it for particular paths. Human output lists files over the limit underFiles over the byte limit. JSON output reports them asfile_bytesviolations, SARIF output under thesprawl-guard/file-bytesrule, and GitHub output as annotations on the file.- The ratchet file has a
[[file_sizes]]table that records the accepted size of a file over its byte limit.updateadds entries andtightenlowers or removes them. Stale entries are reported asfile_bytes_stale. Earlier versions reject a ratchet file with this table.update --importdoesn't add byte entries and keeps the existing ones. - Byte limits in configuration accept a size with a unit, such as
"10 MB"or"1.5 GiB", as well as a number of bytes. This applies tomax_bytes_per_filein[limits]and[[overrides]]and to[traversal].max_parsed_code_file_bytes.kB,MB,GB, andTBare powers of 1000, andKiB,MiB,GiB, andTiBare powers of 1024. Units are case-sensitive, so"10M"and"10 mb"are errors that list the accepted units. explainreports the size and byte limit of a file, with the overrides that set the limit, asfile_bytesin JSON output. For a source file too large to count, it reports why its lines are not counted instead of failing.- Byte limits,
[[file_sizes]]ceilings, andexplainmeasure a file that Git LFS stores by the size its pointer declares, so results don't depend on whether Git LFS has downloaded the file. JSON output marks such a size with"measured_from": "lfs_pointer"and the pointer's own size inpointer_bytes; other sizes have"measured_from": "on_disk". Human, SARIF, and GitHub messages name the pointer. Pointers with the current or the legacyhawser.github.comversion URL are recognized.checkdoesn't count the lines of a source file that is a pointer: it reports anlfs_pointer_sourcewarning with the file'sroleanddeclared_bytes, and keeps the line ceiling for that role. A file smaller than 1 KiB that can't be opened is now reported as an unreadable path, sincecheckcan't tell whether it is a pointer.
Changed
- Human output headings show their group's total, as in
Files over the line limit (3):. - SARIF and GitHub messages for a stale ratchet entry whose path is gone or no longer checked end with
and it is no longer measuredinstead ofand it was not found. [traversal].max_file_bytesis now[traversal].max_parsed_code_file_bytes, since it limits only the files whose code lines are counted. The old name still loads;config upgrade --checkreports it andconfig upgrade --writerenames it.checkno longer stops at a source file too large to count, at a source file that fails to read (now an unreadable path of kindread_file_failed), or at another unreadable path. It reports every such gap along with every violation, in every output format. Under[traversal].unreadable_paths = "fail"the gaps make the check exit2; under"warn"they are warnings, so a file too large to count no longer exits2there.- The JSON report's
statusiserrorin that case,coveragelistsuncounted_filesnext tounreadable_paths, and theerrorobject is gone. - SARIF output reports gaps as tool execution notifications and sets
executionSuccessful. - GitHub output annotates gaps with
::erroror::warning, and prints the report on stdout. - A file too large to count, or one inside an unreadable directory, keeps its ratchet ceiling:
checkdoesn't report it as stale andtightendoesn't remove it. updateandtightenstill refuse to write after an unreadable path.
- The JSON report's
sprawl-guard v0.6.0-beta.1
Immutable
release. Only release title and notes can be modified.
Added
- Sprawl Guard is on PyPI as
sprawl-guard, so Python projects can install it with uv, pip, or pipx and pin it in their lockfile. Each wheel holds only the native binary, for macOS, Windows on x64, Linux on x64 and Arm with glibc 2.35 or newer, and Linux on x64 with musl. The release workflow publishes the wheels through PyPI trusted publishing, with attestations.
sprawl-guard v0.5.3
Immutable
release. Only release title and notes can be modified.
Fixed
- The Linux musl binary, which npm installs on Alpine, no longer slows down when it checks files on several threads. Before, it could be many times slower than on one thread.
sprawl-guard v0.5.2
Immutable
release. Only release title and notes can be modified.
Fixed
- The prebuilt Linux glibc binaries, in the npm packages and the release archives, now run on glibc 2.35 and newer, as in Ubuntu 22.04 and Debian 12. Before, the Arm binary needed glibc 2.39 and didn't start on older systems, and the x64 binary printed a glibc warning on every run.
- On Node.js 22, the npm package no longer prints Node's "WASI is an experimental feature" warning on every run when it falls back to the WebAssembly build.
Known issues
- The Linux musl binary, which npm installs on Alpine, is many times slower than the glibc binary when it checks files on several threads.
sprawl-guard v0.5.0
Immutable
release. Only release title and notes can be modified.
Full Changelog: v0.4.1...v0.5.0
sprawl-guard v0.4.1
Immutable
release. Only release title and notes can be modified.
Full Changelog: v0.4.0...v0.4.1
sprawl-guard v0.4.0
Immutable
release. Only release title and notes can be modified.
Full Changelog: v0.3.2...v0.4.0