feat: initial empty library

This commit is contained in:
Paul Campbell 2024-04-08 14:33:39 +01:00
commit a8a861355c
12 changed files with 203 additions and 0 deletions

13
.cargo/config.toml Normal file
View file

@ -0,0 +1,13 @@
# ./cargo/config
[target.x86_64-unknown-linux-gnu]
linker = "/usr/bin/clang-15"
rustflags = ["-C", "link-arg=--ld-path=/usr/bin/mold", "--cfg", "tokio_unstable"]
[profile.dev]
debug = 0
strip = "debuginfo"
[env]
RUSTLOG = "hyper=warn"
RUSTFLAGS = "--cfg tokio_unstable"

4
.git-hooks/prepare-commit-msg Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
# cc-cli as a commit hook
exec < /dev/tty
cargo bin cc-cli "$@"

18
.gitignore vendored Normal file
View file

@ -0,0 +1,18 @@
# ---> Rust
# Generated by Cargo
# will have compiled files and executables
debug/
target/
# cargo-bin-run cache
.bin
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

1
.rgignore Normal file
View file

@ -0,0 +1 @@
.git/hooks/*.sample

45
.woodpecker/build.yml Normal file
View file

@ -0,0 +1,45 @@
steps:
update-builder-image:
when:
- event: cron
image: docker.io/woodpeckerci/plugin-docker-buildx:3.2
settings:
username: kemitix
repo: git.kemitix.net/kemitix/kxio-builder
auto_tag: true
dockerfile: Dockerfile.builder
dry-run: false # push to remote repo
registry: git.kemitix.net
password:
from_secret: woodpecker-docker-push
build:
when:
- event: push
branch: main
image: git.kemitix.net/kemitix/kxio-builder:latest
environment:
CARGO_TERM_COLOR: always
lint:
when:
- event: push
branch: main
image: git.kemitix.net/kemitix/kxio-builder:latest
environment:
CARGO_TERM_COLOR: always
commands:
- ls -l /usr/local/cargo/bin/
- cargo fmt --all -- --check
- cargo clippy -- -D warnings -W clippy::nursery -W clippy::unwrap_used -W clippy::expect_used
test:
when:
- event: push
branch: main
image: git.kemitix.net/kemitix/kxio-builder:latest
environment:
CARGO_TERM_COLOR: always
commands:
- cargo test

14
.woodpecker/release.yml Normal file
View file

@ -0,0 +1,14 @@
# INFO: https://woodpecker-ci.org/plugins/Gitea%20Release
steps:
publish:
when:
- event: tag
ref: refs/tags/v*
image: docker.io/woodpeckerci/plugin-gitea-release:0.3
settings:
base_url: https://git.kemitix.net
api_key:
from_secret: FORGEJO_RELEASE_PLUGIN
target: main
prerelease: true

View file

@ -0,0 +1,13 @@
# INFO: https://woodpecker-ci.org/plugins/TODO-Checker
steps:
todo_check:
image: codeberg.org/epsilon_02/todo-checker:1.1
when:
- event: push
branch: main
settings:
# kxio-woodpecker-todo-checker - read:issue
repository_token: '4acf14f93747e044aa2d1397367741b53f3d4f8f'
prefix_regex: "(#|//) (TODO|FIXME): "
debug: false

17
Cargo.toml Normal file
View file

@ -0,0 +1,17 @@
[package]
name = "kxio"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
# logging
tracing = "0.1"
# fs
tempfile = "3.10"
[package.metadata.bin]
# Conventional commits githook
cc-cli = { version = "0.1" }

9
LICENSE Normal file
View file

@ -0,0 +1,9 @@
MIT License
Copyright (c) 2024 Paul Campbell <pcampbell@kemitix.net>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

63
bacon.toml Normal file
View file

@ -0,0 +1,63 @@
# This is a configuration file for the bacon tool
#
# Bacon repository: https://github.com/Canop/bacon
# Complete help on configuration: https://dystroy.org/bacon/config/
default_job = "check"
reverse = true
[jobs.check]
command = ["cargo", "check", "--color", "always"]
need_stdout = false
[jobs.fmt]
command = ["cargo", "fmt"]
need_stdout = false
on_success = "job:check"
[jobs.todo-checker]
command = ["just", "todo-checker"]
need_stdout = true
[jobs.check-all]
command = ["cargo", "check", "--all-targets", "--color", "always"]
need_stdout = false
[jobs.clippy]
command = ["cargo", "clippy", "--all-targets", "--color", "always", "--", "-Dwarnings", "-Wclippy::nursery", "-Wclippy::unwrap_used", "-Wclippy::expect_used"]
# "-Wclippy::pedantic",
need_stdout = false
[jobs.test]
command = ["cargo", "nextest", "run", "--no-capture", "--color", "always"]
[jobs.doc]
command = ["cargo", "doc", "--color", "always", "--no-deps"]
need_stdout = false
# If the doc compiles, then it opens in your browser and bacon switches
# to the previous job
[jobs.doc-open]
command = ["cargo", "doc", "--color", "always", "--no-deps", "--open"]
need_stdout = false
on_success = "back" # so that we don't open the browser at each change
# You can run your application and have the result displayed in bacon,
# *if* it makes sense for this crate. You can run an example the same
# way. Don't forget the `--color always` part or the errors won't be
# properly parsed.
# If you want to pass options to your program, a `--` separator
# will be needed.
[jobs.run]
command = [ "cargo", "run", "--color", "always" ]
need_stdout = true
allow_warnings = true
# You may define here keybindings that would be specific to
# a project, for example a shortcut to launch a specific job.
# Shortcuts to internal functions (scrolling, toggling, etc.)
# should go in your personal global prefs.toml file instead.
[keybindings]
# alt-m = "job:my-job"
f = "job:fmt"
alt-t = "job:todo-checker"

3
justfile Normal file
View file

@ -0,0 +1,3 @@
install-hooks:
@echo "Installing git hooks"
git config core.hooksPath .git-hooks

3
src/lib.rs Normal file
View file

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}