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
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# .cargo/config.toml
#
# Formatting requires nightly rustfmt — use ./scripts/fmt (see rustfmt.toml).
51 changes: 51 additions & 0 deletions .cursor/rules/rust-standards.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
description: Rust coding standards for shwild.Rust (aligned with Synesis Information Systems' internal project standards)
globs: **/*.rs
alwaysApply: false
---

# Rust Software Quality Rules


## DOC_76 (The 76-Rule for Documentation Comments)

- Documentation comments (`///`, `//!`) on **public** constructs must be at
most **76 characters** per line, including leading indentation;
- Wrap text **greedily** (pack to maximum width) — do not wrap early if the
next word fits on the current line;
- Code blocks inside doc comments (triple backticks) are exempt;
- List items in doc comments should end with a semicolon;
- Inline comments (`//`) inside functions are limited to **100 characters**
per line, wrapped greedily;
- Private/non-`pub` constructs are exempt from DOC_76 for their doc
comments;

Run `./scripts/check_doc_76.py` to verify compliance.


## DERIVE_LAYOUT (Derive Layout & Formatting)

Multi-trait `#[derive(...)]` macros must be split into separate,
single-trait lines, ordered alphabetically by trait name. Tightly coupled
traits may remain on one line: `#[derive(Eq, PartialEq)]`,
`#[derive(Ord, PartialOrd)]`.

`rustfmt.toml` sets `merge_derives = false` to preserve this layout.

Run `./scripts/check_derives.py` to verify compliance.


## RUST_TEST_NAMING

All test methods must use `SHOUTING_SNAKE_CASE` - e.g. `TEST_PARSING()` -
except where a word in the snake case represents a specific construct (such
as a struct, enum, type, function, macro, or field name), in which case that
word must preserve its exact correct case - e.g.
`TEST_AutoBuffer_WITH_INTERNAL_SIZE()`, `TEST_doom_scope_1()`,
`TEST_type_name_only_WITH_SomeCustomType()`.

When a construct is embedded as a SHOUTING_SNAKE_CASE constant (or other
construct name), use an extra underscore on each side as a delimiter - e.g.
`TEST_MatcherSequence_WITH_Range_HAVING__IGNORE_CASE__1()`.

Run `./scripts/check_test_names.py` to verify compliance.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

*.rs linguist-language=Rust
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI

on:
push:
branches:
- master
- dev
- boilerplate
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
check:
name: Test, Clippy, Fmt, Checkers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Install nightly rustfmt
run: rustup toolchain install nightly --profile minimal --component rustfmt

- uses: Swatinem/rust-cache@v2

- name: cargo test
run: cargo test --locked

- name: cargo clippy
run: cargo clippy --all-targets --locked -- -D warnings

- name: cargo build (examples)
run: cargo build --examples --locked

- name: cargo build (character-play example)
run: cargo build --example character-play --features test-regex --locked

- name: cargo doc
run: cargo doc --no-deps --locked

- name: rustfmt
run: ./scripts/fmt --check

- name: DOC_76 checker
run: python3 scripts/check_doc_76.py

- name: RUST_TEST_NAMING checker
run: python3 scripts/check_test_names.py

- name: DERIVE_LAYOUT checker
run: python3 scripts/check_derives.py

msrv:
name: MSRV (1.79)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@1.79.0

- uses: Swatinem/rust-cache@v2

- name: cargo check (library)
# Full `cargo test` needs dev-deps (criterion → clap_lex 2024 edition),
# which exceeds MSRV; the stable job runs the full test suite.
# MSRV 1.79: default `lookup-ranges` → collect-rs → base-traits uses
# `CStr::count_bytes()` (stabilized in Rust 1.79).
run: cargo check --lib --locked
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# directories (by name)

/_build/
/scripts/__pycache__/
/scratch/
/target/

Expand Down
57 changes: 57 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# shwild.Rust - CHANGES <!-- omit in toc -->


## 0.1.4 - 8th July 2026

* added **CHANGES.md** (back-filled) and **NEWS.md**;
* added **EXAMPLES.md** and per-example documentation;
* **README.md** badges, dependency links, related projects, and `null-feature` documentation;
* added crate-level `//!` documentation;
* added CI (`.github/workflows/ci.yml`) and quality scripts (`scripts/fmt`, checkers);
* added `rust-version` (MSRV 1.79);
* renamed `.rustfmt.toml` => **rustfmt.toml**; updated formatting settings;
* added `.gitattributes`;
* shortened `description` in **Cargo.toml**;
* Clippy and test-naming fixes for CI; `check_test_names.py` allows `__CONSTRUCT__` padding;
* upgraded **criterion** from 0.5 => 0.8;


## 0.1.3 - 28th March 2025

* crates.io packaging metadata — `categories`, `keywords`, `documentation`, and expanded `description`;
* added `exclude` for `target` and `.github` in **Cargo.toml**;
* added **TODO.md**;
* **character-play** changed from `[[bin]]` to `[[example]]`;


## 0.1.2 - 3rd November 2024

* added `test-regex` feature — optional **regex** dependency for benchmarks and scratch programs;
* enabled `lookup-ranges` in default features;
* added **cw-regex** benchmark;
* added **character-play** scratch program;
* added `regex_comparision_tests` unit tests (gated on `test-regex`);


## 0.1.1 - 3rd November 2024

* added `lookup-ranges` feature — optional **collect-rs** dependency for `UnicodePointMap`-based range matching;
* added **Cargo.lock**;
* README: added Features section; clarified Wild-1 escape behaviour in pattern elements;


## 0.1.0 - 3rd November 2024

* first public release;
* added `matches()` and `shwild_matches!()`;
* added `CompiledMatcher`;
* added `Error`, `Result`, and `IGNORE_CASE`;
* added example programs **list-matching-files** and **list-matching-files-compiled**;
* added benchmarks **range_string-creation_functions**, **shwild-compiled_matcher**, and **shwild-matches**;
* added **README.md**;


All history before this day is moot!


<!-- ########################### end of file ########################### -->
Loading
Loading