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
53 changes: 42 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,27 @@ on:
push:
branches:
- master
- dev
- boilerplate
- idiomatic
- rc1
- rc2
- rc3
pull_request:

permissions:
contents: read

defaults:
run:
shell: bash

env:
CARGO_TERM_COLOR: always

jobs:
check:
name: Test, Clippy, Fmt, Checkers
name: Stable checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -21,22 +33,19 @@ jobs:
with:
components: clippy

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

- uses: Swatinem/rust-cache@v2

- name: cargo test
run: cargo test --locked
- name: cargo test (all targets)
run: cargo test --all-targets --locked

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

- name: cargo build (test-doomgram example)
run: cargo build --examples --features test-doomgram --locked

- name: cargo doc
run: cargo doc --no-deps --locked
run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --locked

- name: rustfmt
run: ./scripts/fmt --check
Expand All @@ -50,6 +59,28 @@ jobs:
- name: DERIVE_LAYOUT checker
run: python3 scripts/check_derives.py

- name: cargo publish (dry run)
run: cargo publish --dry-run --locked

feature:
name: test-doomgram feature checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- name: cargo test (test-doomgram)
run: cargo test --features test-doomgram --locked

- name: cargo build (examples with test-doomgram)
run: cargo build --examples --features test-doomgram --locked

- name: cargo doc (test-doomgram)
run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --features test-doomgram --locked

msrv:
name: MSRV (1.74)
runs-on: ubuntu-latest
Expand All @@ -61,6 +92,6 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: cargo check (library)
# Full `cargo test` needs dev-deps (criterion → clap_lex 2024 edition),
# which exceeds MSRV 1.74; the stable job runs the full test suite.
# Full tests need dev-deps (criterion -> clap_lex 2024 edition);
# stable runs the complete test suite; MSRV only checks the library.
run: cargo check --lib --locked
72 changes: 68 additions & 4 deletions .vimrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,70 @@
" Synesis C/C++ project .vimrc — aligned with .sis/.vscode/c_cxx/settings.json

set nocompatible
filetype indent plugin on
syntax enable
set autoindent
set expandtab
set shiftwidth=4
set softtabstop=4
set tabstop=4
set backspace=indent,eol,start
set hlsearch
set incsearch
set number

" files.insertFinalNewline
set eol
set fixeol

" editor.renderWhitespace: all
set list
set listchars=tab:->,trail:-,extends:>,precedes:<,nbsp:+

" editor.detectIndentation: false — global defaults (editor.tabSize: 2, insertSpaces: false)
set tabstop=2
set shiftwidth=2
set softtabstop=2
set noexpandtab
set colorcolumn=76

" colorcolumn draws a full-column tint in Vim (not a VS Code-style 1px line).
" Keep it subtle via the ColorColumn highlight group; reapply after colorscheme changes.
if has('termguicolors')
" set termguicolors
endif

function! s:ConfigureColorColumn() abort
highlight ColorColumn ctermbg=236 guibg=#2a2a2a cterm=NONE gui=NONE
endfunction

call s:ConfigureColorColumn()
autocmd ColorScheme * call s:ConfigureColorColumn()

" files.trimTrailingWhitespace
autocmd BufWritePre * %s/\s\+$//e

augroup sis_c_cxx
autocmd!

" [c] / [cpp]
autocmd FileType c,cpp setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=60,64,68,72,76

" [rust]
autocmd FileType rs setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=76

" [cmake]
autocmd FileType cmake setlocal noexpandtab tabstop=4 shiftwidth=4 softtabstop=4

" [shellscript]
autocmd FileType sh,bash,zsh setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 colorcolumn=60,76

" [bat]
autocmd FileType bat,dosbatch setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=60,76

" [json] / [markdown] / [yaml] / [ruby]
autocmd FileType json,markdown,yaml,ruby setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2

" [python]
autocmd FileType python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=60,76

" [toml]
autocmd FileType toml setlocal noexpandtab tabstop=2 shiftwidth=2 softtabstop=2
augroup END

13 changes: 11 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Diagnosticism.Rust - CHANGES <!-- omit in toc -->
# Diagnosticism.Rust - Changes <!-- omit in toc -->


## 0.4.3 - 31st August 2026

* added docs.rs metadata for the optional `test-doomgram` feature;
* strengthened **ci.yml** with locked stable, feature, documentation, example, formatting, checker, package, and MSRV validation;
* pinned **scripts/fmt** to nightly-2026-08-08 for reproducible formatting;
* corrected public rustdoc width and warning issues;
* aligned **NEWS.md**, **README.md**, and **EXAMPLES.md** release and example documentation;
* updated the **LICENSE** copyright range through 2026;


## 0.4.2 - 10th July 2026
Expand Down Expand Up @@ -81,4 +91,3 @@ All history before this day is moot!


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

2 changes: 1 addition & 1 deletion Cargo.lock

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

10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ categories = [
"development-tools::profiling",
]
description = "Miscellaneous discrete and simple diagnostics facilities (for Rust)"
documentation = "https://docs.rs/diagnosticism"
edition = "2021"
homepage = "https://github.com/synesissoftware/Diagnosticism.Rust"
keywords = [
Expand All @@ -26,7 +27,14 @@ name = "diagnosticism"
readme = "README.md"
repository = "https://github.com/synesissoftware/Diagnosticism.Rust"
rust-version = "1.74"
version = "0.4.2"
version = "0.4.3"

# docs.rs builds the optional `rand`-backed example path.

[package.metadata.docs.rs]
features = [
"test-doomgram",
]


# ##########################################################
Expand Down
16 changes: 7 additions & 9 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Diagnosticism.Rust Examples

|Name|Source & Description|Summary|
|---|---|---|
|**debug_squeezer**|[examples/debug_squeezer.rs](/examples/debug_squeezer.rs)<br/>[examples/debug_squeezer.md](/examples/debug_squeezer.md)|An example using **Diagnosticism.Rust**'s `DebugSqueezer` type to simplify the `Debug` form of a user-defined type.|
|**doomgram**|[examples/doomgram.rs](/examples/doomgram.rs)<br/>[examples/doomgram.md](/examples/doomgram.md)|An example using **Diagnosticism.Rust**'s `DoomGram` type to represent the performance of some time-consuming operations, including `to_strip()`, `to_mmm()`, and `to_nmmm()`.|
|**ellipsis**|[examples/ellipsis.rs](/examples/ellipsis.rs)<br/>[examples/ellipsis.md](/examples/ellipsis.md)|An example using **Diagnosticism.Rust**'s `Ellipsis` type to shorten the `Debug` form of a user-defined type.|
|**password**|[examples/password.rs](/examples/password.rs)<br/>[examples/password.md](/examples/password.md)|An example using **Diagnosticism.Rust**'s `Password` type to secure the `Debug` form of a user-defined type.|
# Diagnosticism.Rust - Examples <!-- omit in toc -->

| Name | Source & Description | Summary |
| ------------------ | ---------------------------------------------------------------------------------------------------------- | ------- |
| **debug_squeezer** | [examples/debug_squeezer.rs](./examples/debug_squeezer.rs)<br/>[examples/debug_squeezer.md](./examples/debug_squeezer.md) | An example using **Diagnosticism.Rust**'s `DebugSqueezer` type to simplify the `Debug` form of a user-defined type. |
| **doomgram** | [examples/doomgram.rs](./examples/doomgram.rs)<br/>[examples/doomgram.md](./examples/doomgram.md) | An example using **Diagnosticism.Rust**'s `DoomGram` type to represent the performance of some time-consuming operations, including `to_strip()`, `to_mmm()`, and `to_nmmm()`. |
| **ellipsis** | [examples/ellipsis.rs](./examples/ellipsis.rs)<br/>[examples/ellipsis.md](./examples/ellipsis.md) | An example using **Diagnosticism.Rust**'s `Ellipsis` type to shorten the `Debug` form of a user-defined type. |
| **password** | [examples/password.rs](./examples/password.rs)<br/>[examples/password.md](./examples/password.md) | An example using **Diagnosticism.Rust**'s `Password` type to secure the `Debug` form of a user-defined type. |


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

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Diagnosticism.Rust - BSD 3-Clause License

Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
20 changes: 20 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Diagnosticism.Rust - News <!-- omit in toc -->

| Date | News Item |
| ---------------- | -------------------------------------------------------------------------------------------------- |
| 31st August 2026 | [Diagnosticism.Rust 0.4.3](https://github.com/synesissoftware/Diagnosticism.Rust/releases/tag/0.4.3) released |
| 10th July 2026 | [Diagnosticism.Rust 0.4.2](https://github.com/synesissoftware/Diagnosticism.Rust/releases/tag/0.4.2) released |
| 7th July 2026 | [Diagnosticism.Rust 0.4.1](https://github.com/synesissoftware/Diagnosticism.Rust/releases/tag/0.4.1) released |
| 30th June 2026 | [Diagnosticism.Rust 0.4.0](https://github.com/synesissoftware/Diagnosticism.Rust/releases/tag/0.4.0) released |
| 28th June 2026 | [Diagnosticism.Rust 0.3.2](https://github.com/synesissoftware/Diagnosticism.Rust/releases/tag/0.3.2) released |
| 28th June 2026 | [Diagnosticism.Rust 0.3.1](https://github.com/synesissoftware/Diagnosticism.Rust/releases/tag/0.3.1) released |
| 28th June 2026 | [Diagnosticism.Rust 0.3.0](https://github.com/synesissoftware/Diagnosticism.Rust/releases/tag/0.3.0) released |
| 27th June 2026 | [Diagnosticism.Rust 0.2.1](https://github.com/synesissoftware/Diagnosticism.Rust/releases/tag/0.2.1) released |
| 24th July 2025 | [Diagnosticism.Rust 0.2.0](https://github.com/synesissoftware/Diagnosticism.Rust/releases/tag/0.2.0) released |
| 29th March 2025 | [Diagnosticism.Rust 0.1.0](https://github.com/synesissoftware/Diagnosticism.Rust/releases/tag/0.1.0) released |
| 19th December 2024 | [Diagnosticism.Rust 0.0.2](https://github.com/synesissoftware/Diagnosticism.Rust/releases/tag/0.0.2) released |
| 13th September 2024 | [Diagnosticism.Rust 0.0.1](https://github.com/synesissoftware/Diagnosticism.Rust/releases/tag/0.0.1) released |
| 27th August 2024 | [Diagnosticism.Rust 0.0.0](https://github.com/synesissoftware/Diagnosticism.Rust/releases/tag/0.0.0) released |


<!-- ########################### end of file ########################### -->
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Other facilities (that are not directly related to `Debug`) will be added to the
Reference in **Cargo.toml** in the usual way:

```toml
diagnosticism = { version = "0" }
diagnosticism = { version = "0.4" }
```


Expand Down Expand Up @@ -84,7 +84,7 @@ The following function is re-exported at the crate root (and defined in the [`di

For example:

```Rust
```rust
use diagnosticism::nanoseconds_to_string;

assert_eq!( "123.4ms", nanoseconds_to_string(123_456_789, ""));
Expand Down Expand Up @@ -138,7 +138,7 @@ Examples are provided in the ```examples``` directory, along with a markdown des

The example program **doomgram** (in **examples** directory, built with feature `test-doomgram`), illustrates use of `DoomGram` to capture the order-of-magnitude histogram of a large number of small random delays, and to format min/mean/max duration summaries. The program source is:

```Rust
```rust
// examples/doomgram.rs : example program illustrating use of `DoomGram`

use diagnosticism::{
Expand Down Expand Up @@ -262,7 +262,7 @@ Naturally, in a live system one would not be employing the exploded `Debug` view

In the example program **ellipsis** (in **examples** directory), the following types are defined to illustrate the benefit of using `Ellipsis` to provide concise `Debug` output in terse (i.e. non-`#alternate()`) form:

```Rust
```rust
/// Large structure that provides the internals of `Thing`
#[derive(Clone)]
#[derive(Debug)]
Expand Down Expand Up @@ -358,4 +358,3 @@ Crates upon which **Diagnosticism.Rust** has development dependencies:


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

5 changes: 2 additions & 3 deletions examples/debug_squeezer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Diagnosticism.Rust Example - **debug_squeezer**
# Diagnosticism.Rust - Example - **debug_squeezer**

## Summary

Expand All @@ -7,7 +7,7 @@ An example using **Diagnosticism.Rust**'s `DebugSqueezer` type to simplify the `

## Source

```Rust
```rust
// examples/debug_squeezer.rs : example program illustrating use of `DebugSqueezer`

#![allow(dead_code)]
Expand Down Expand Up @@ -237,4 +237,3 @@ it gives the output:


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

5 changes: 2 additions & 3 deletions examples/doomgram.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Diagnosticism.Rust Example - **doomgram**
# Diagnosticism.Rust - Example - **doomgram**

## Summary

Expand All @@ -7,7 +7,7 @@ An example using **Diagnosticism.Rust**'s `DoomGram` type to represent the perfo

## Source

```Rust
```rust
// examples/doomgram.rs : example program illustrating use of `DoomGram`

use diagnosticism::{
Expand Down Expand Up @@ -135,4 +135,3 @@ The three formatted lines use complementary views of the same data:


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

5 changes: 2 additions & 3 deletions examples/ellipsis.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Diagnosticism.Rust Example - **ellipsis**
# Diagnosticism.Rust - Example - **ellipsis**

## Summary

Expand All @@ -7,7 +7,7 @@ An example using **Diagnosticism.Rust**'s `Ellipsis` type to shorten the `Debug`

## Source

```Rust
```rust
// examples/ellipsis.rs : demonstrates use of `Ellipsis`

#![allow(dead_code)]
Expand Down Expand Up @@ -192,4 +192,3 @@ Verbose `Debug` form of `thing2`: Thing2 {


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

5 changes: 2 additions & 3 deletions examples/password.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Diagnosticism.Rust Example - **password**
# Diagnosticism.Rust - Example - **password**

## Summary

Expand All @@ -7,7 +7,7 @@ An example using **Diagnosticism.Rust**'s `Password` type to secure the `Debug`

## Source

```Rust
```rust
use diagnosticism::Password;

use std::fmt as std_fmt;
Expand Down Expand Up @@ -62,4 +62,3 @@ credentials: Credentials {


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

Loading
Loading