-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
344a44f
commit 7429e29
Showing
10 changed files
with
152 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: cargo | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
time: "20:00" | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Test 🤖 | ||
|
||
on: | ||
pull_request: | ||
push: | ||
paths: | ||
- 'src/**' | ||
branches: | ||
- '**' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- os: macOS-latest | ||
target: x86_64-apple-darwin | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: dtolnay/rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
targets: ${{ matrix.target }} | ||
|
||
- name: Run cargo test | ||
run: cargo test --locked --target ${{ matrix.target }} | ||
|
||
- name: Run tests feature variation | ||
run: cargo test --locked --target ${{ matrix.target }} --no-default-features | ||
rusfmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: dtolnay/rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: rustfmt | ||
|
||
- name: Check formatting | ||
run: cargo fmt --all -- --check | ||
|
||
clippy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: dtolnay/rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
|
||
- name: Check formatting | ||
run: cargo clippy --all-features -- -D warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,10 @@ | |
name = "mtoc" | ||
version = "0.1.0" | ||
edition = "2021" | ||
authors = ["containerscrew [email protected]"] | ||
repository = "https://github.com/containerscrew/gitrack" | ||
rust-version = "1.80.1" | ||
|
||
|
||
[dependencies] | ||
clap = { version = "4.5.16", features = ["derive"] } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
SHELL:=/bin/sh | ||
.PHONY: all | ||
|
||
BINARY_NAME = mtoc | ||
|
||
|
||
help: ## this help | ||
@awk 'BEGIN {FS = ":.*?## "; printf "Usage:\n make \033[36m<target> \033[0m\n\nTargets:\n"} /^[a-zA-Z0-9_-]+:.*?## / {gsub("\\\\n",sprintf("\n%22c",""), $$2);printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | ||
|
||
pre-commit: ## Run pre-commit | ||
pre-commit run -a | ||
|
||
package: ## Package binary with zip | ||
zip -j ${BINARY_NAME}-$(PLATFORM).zip target/$(TARGET)/release/${BINARY_NAME} | ||
|
||
generate-changelog: ## Generate changelog using git cliff | ||
git cliff --output CHANGELOG.md | ||
|
||
build: ## Build binary | ||
cargo build --release | ||
|
||
install: ## Install binary | ||
cargo install --path . | ||
|
||
uninstall: ## Uninstall binary | ||
cargo uninstall ${BINARY_NAME} | ||
|
||
build: ## Build binary | ||
cargo build --release --locked | ||
|
||
cargo-fix: ## Run cargo fix | ||
cargo fix --bin mtoc | ||
|
||
mtoc: ## Create table of contents with doctoc | ||
mtoc -d . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
|
||
|
||
|
||
<h1 align="center">mtoc 📄</h1> | ||
<p align="center">Markdown table of contents generator</p> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[changelog] | ||
header = """ | ||
# Changelog\n | ||
All notable changes to this project will be documented in this file.\n | ||
""" | ||
|
||
body = """ | ||
{% if version %}\ | ||
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} | ||
{% else %}\ | ||
## [unreleased] | ||
{% endif %}\ | ||
{% for commit in commits | unique(attribute="message") %} | ||
- {{ commit.message | upper_first }} | ||
{% endfor %}\n | ||
""" | ||
|
||
footer = """ | ||
<!-- generated by git-cliff --> | ||
""" | ||
trim = true | ||
|
||
[git] | ||
conventional_commits = false | ||
filter_unconventional = false | ||
split_commits = false | ||
tag_pattern = "^v[0-9]+\\.[0-9]+\\.[0-9]+$" | ||
sort_commits = "oldest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
- [Hellooooo!!!](#hellooooo!!!) | ||
<!-- END OF TOC --> | ||
|
||
|
||
# Hi! | ||
|
||
## Hello!! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
- [Test 3](#test-3) | ||
<!-- END OF TOC --> | ||
|
||
|
||
# Test 1 | ||
|
||
## Test 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters