Skip to content

Commit

Permalink
Merge pull request #1 from axodotdev/impl
Browse files Browse the repository at this point in the history
initial impl
  • Loading branch information
Gankra authored Jan 5, 2024
2 parents 9ac92b4 + 98cd8c1 commit a64810d
Show file tree
Hide file tree
Showing 8 changed files with 678 additions and 20 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Rust

on:
pull_request:
push:
branches:
- main
schedule:
- cron: '11 7 * * 1,4'

env:
RUSTFLAGS: -Dwarnings

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Run cargo check
run: |
cargo check --all --tests
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run cargo fmt
run: |
cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Run cargo clippy
run: |
cargo clippy --tests --examples
docs:
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Run rustdoc
run: |
cargo doc --no-deps
feature-check:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-hack
- name: Run cargo hack powerset
run: |
cargo hack check --feature-powerset --no-dev-deps
os-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
# note that bare "--no-default-features" isn't supported, you must pick a backend!
feature-flags: ["", "--all-features"]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Run cargo test
run: |
cargo test ${{ matrix.feature-flags }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

Thanks so much for your interest in contributing to `axohtml`. We are excited
Thanks so much for your interest in contributing to `axoprocess`. We are excited
about the building a community of contributors to the project. Here's some
guiding principles for working with us:

Expand All @@ -20,12 +20,12 @@ that your fix works.
**3. Overcommunicate**

In all scenarios, please provide as much context as possible- you may not think
it's important but it may be!
it's important but it may be!

**4. Patience**

Axo is a very small company, it's possible that we may not be able to
immediately prioritize your issue. We are excite to develop a community of
immediately prioritize your issue. We are excite to develop a community of
contributors around this project, but it won't always be on the top of our to-do
list, even if we wish it could be.

Expand Down
139 changes: 139 additions & 0 deletions Cargo.lock

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

16 changes: 16 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "axoprocess"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html


[features]
default = []
stdout_to_stderr_modern = []

[dependencies]
miette = "5.10.0"
thiserror = "1.0.50"
tracing = "0.1.40"
22 changes: 5 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
# oss-repo-template
> 📄 a template for axodotdev's open source repositories
# axoprocess

This is a template repo for @axodotdev's open source projects.
[![crates.io](https://img.shields.io/crates/v/axoprocess.svg)](https://crates.io/crates/axoprocess)
[![docs](https://docs.rs/axoprocess/badge.svg)](https://docs.rs/axoprocess)
[![Rust CI](https://github.com/axodotdev/axoprocess/workflows/Rust/badge.svg?branch=main)](https://github.com/axodotdev/axoprocess/actions/workflows/ci.yml)

## Quickstart

The README should contain a brief set of steps on how to go from installation to
"Hello World". It should also link to more in depth and comprehensive install
and usage documentation.

For a package, this should indicate how to add the package (e.g. cut and paste
into `Cargo.toml`) and then a short example.

For a cli, this should explain the preferred installation method and then offer
the most common set of commands (e.g. `axo init && axo run`).

The code block for the example or command set shouldn't exceed 20 lines, but
exceptions can be made.
Nicer defaults for invoking CLI Commands.

## License

Expand Down
30 changes: 30 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//! Errors!

use miette::Diagnostic;
use thiserror::Error;

/// Gotta love a newtyped Result
pub type Result<T> = std::result::Result<T, AxoprocessError>;

/// An error from executing a Command
#[derive(Debug, Error, Diagnostic)]
pub enum AxoprocessError {
/// The command fundamentally failed to execute (usually means it didn't exist)
#[error("failed to {summary}")]
Exec {
/// Summary of what the Command was trying to do
summary: String,
/// What failed
#[source]
cause: std::io::Error,
},
/// The command ran but signaled some kind of error condition
/// (assuming the exit code is used for that)
#[error("failed to {summary} (status: {status})")]
Status {
/// Summary of what the Command was trying to do
summary: String,
/// What status the Command returned
status: std::process::ExitStatus,
},
}
Loading

0 comments on commit a64810d

Please sign in to comment.