Skip to content
Open
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
39 changes: 39 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
root = true

# Language indent/EOL/charset overlap with .vscode/settings.json.
# Rulers, renderWhitespace, detectIndentation, mergeEditor, and
# language-server settings cannot be expressed here — they stay in
# settings.json.

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

# [json]
[*.json]
indent_size = 2
indent_style = space

# [markdown]
[*.md]
indent_size = 2
indent_style = space

# [shellscript]
[*.{bash,sh,zsh}]
indent_size = 2
indent_style = space

# [yaml]
[*.{yaml,yml}]
indent_size = 2
indent_style = space

# [zig]
[*.zig]
indent_size = 4
indent_style = space
68 changes: 68 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# .gitattributes — Zig (GitHub-hosted)
#
# Sources: GitHub Docs (line endings), git-scm gitattributes (no built-in
# zig diff driver), ziglang conventions for artefacts, github-linguist overrides.

# Default: detect text, normalize to LF in the repository
* text=auto

# --- Source ---
*.zig text eol=lf
*.zon text eol=lf
build.zig text eol=lf
build.zig.zon text eol=lf

# --- Scripts ---
*.bash text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
*.sh text eol=lf
*.zsh text eol=lf

# --- Docs / meta ---
*.adoc text
*.markdown text diff=markdown
*.md text diff=markdown
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
LICENSE text
NEWS text
README text
TODO text
.gitattributes text
.gitignore text

# --- Serialisation ---
*.json text
*.toml text
*.xml text
*.yaml text
*.yml text

# --- Binary ---
*.a binary
*.exe binary
*.o binary
*.obj binary
*.so binary

# --- Archives / images (common) ---
*.gif binary
*.gz binary
*.ico binary
*.jpeg binary
*.jpg binary
*.png binary
*.tar binary
*.zip binary

# --- GitHub Linguist ---
# Prefer .gitignore for these; mark if ever committed
**/.zig-cache/** linguist-generated
**/zig-cache/** linguist-generated
**/zig-out/** linguist-generated
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

on:
push:
branches:
- master
- dev
- boilerplate
- idiomatic
- rc1
- rc2
- rc3
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint & Format
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0

- name: Check Formatting
run: zig fmt --check .

test:
name: Build & Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0

- name: Run Unit Tests
run: zig build test --global-cache-dir .zig-cache

- name: Run Example
run: zig build run-example --global-cache-dir .zig-cache
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Synesis Information Systems .gitignore for Zig projects


# directories (by name)

/.zig-cache/
/scratch/
/zig-out/


# directories (by pattern)


# files (by name)

.DS_Store


# files (by pattern)

*~
*.sw[pon]
*.tmp
*.zip
64 changes: 64 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
" Synesis C/C++ & Zig project .vimrc — aligned with .vscode/settings.json

set nocompatible
filetype indent plugin on
syntax enable
set autoindent
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: 4, insertSpaces: true)
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set colorcolumn=76

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_zig
autocmd!
" [bat]
autocmd FileType bat,dosbatch setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 colorcolumn=60,76

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

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

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

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

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

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

augroup END
36 changes: 36 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"[json]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
},
"[markdown]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
},
"[toml]": {
"editor.insertSpaces": false,
"editor.tabSize": 2,
},
"[zig]": {
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit",
},
"editor.defaultFormatter": "ziglang.vscode-zig",
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.suggest.insertMode": "replace",
"editor.tabSize": 4,
},
"cmake.configureOnOpen": false,
"debug.allowBreakpointsEverywhere": true,
"editor.detectIndentation": false,
"editor.insertSpaces": false,
"editor.renderWhitespace": "all",
"editor.rulers": [ 76 ],
"editor.tabSize": 2,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"git.mergeEditor": false,
"zig.zls.enabled": "on",
}
21 changes: 21 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# woad.Zig - Authors <!-- omit in toc -->


## Major Contributors

| Name | GitHub |
| ----------- | --------------------------------- |
| Matt Wilson | [mwsis](https://github.com/mwsis) |


## Defect reports, fixes and suggestions (for which we are very grateful)

| Name | GitHub |
| ------- | ------ |
| \<none> | |


Contributions are welcomed.


<!-- ########################### end of file ########################### -->
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# woad.Zig - Changes <!-- omit in toc -->


## 0.0.1 - 18th September 2026

* SGR colour and reset codes (`RESET`, `FG_*`, `BG_*`, including bright variants);


<!-- ########################### end of file ########################### -->
9 changes: 9 additions & 0 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# woad.Zig - Examples <!-- omit in toc -->


| Name | Source | Summary |
| ----------------- | ---------------------------------------------------------- | ----------------------------------------------------------------------- |
| **show_colours** | [examples/show_colours.zig](./examples/show_colours.zig) | Prints standard, bright, and background SGR samples via **woad** codes |


<!-- ########################### end of file ########################### -->
30 changes: 30 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
woad.Zig - BSD 3-Clause License

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

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# woad.Zig - News <!-- omit in toc -->


| Date | News Item | Details |
| ------------------- | --------- | ------- |
| 18th September 2026 | [**woad.Zig** 0.0.1](https://github.com/synesissoftware/woad.Zig/releases/tag/0.0.1) | SGR colour and reset codes |


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