Skip to content

Commit

Permalink
chore: let there be light
Browse files Browse the repository at this point in the history
  • Loading branch information
wizard-28 committed Oct 8, 2022
0 parents commit 8bcd161
Show file tree
Hide file tree
Showing 16 changed files with 2,550 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
crate
mut
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "cargo"
# Look for `Cargo.toml` and `Cargo.lock` in the root directory
directory: "/"
# Check for updates every Monday
schedule:
interval: "weekly"
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
# Check for updates every Monday
schedule:
interval: "weekly"
open-pull-requests-limit: 10
100 changes: 100 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: CI # Continuous Integration

on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:

jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: test
args: --doc --all-features --workspace

rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Check formatting
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: fmt
args: --all -- --check

spellcheck:
name: Spellcheck
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Spellcheck
uses: codespell-project/actions-codespell@master
with:
builtin: clear,rare,informal,code
ignore_words_file: .codespellignore

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: clippy
- uses: Swatinem/rust-cache@v1
- name: Clippy check
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features --workspace -- -D warnings -D clippy::pedantic

docs:
name: Docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --document-private-items --all-features --workspace --examples
28 changes: 28 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Security audit

on:
schedule:
# Runs at 00:00 UTC everyday
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
pull_request:

jobs:
audit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Ensure that the latest version of Cargo is installed
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
38 changes: 38 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
ci:
# Skip hooks requiring `just` to be installed
skip: [codespell, fmt, clippy]

repos:
# General
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
args: ["--fix=lf"]
- id: trailing-whitespace
- repo: local
hooks:
- id: codespell
name: Check for misspellings
description: Checks for common misspellings in text files
language: system
entry: just spellcheck
types: [text]
- id: fmt
name: Format files
description: Format files with cargo fmt
language: system
entry: just fmt
types: [rust]
- id: clippy
name: Lint code
description: Lint rust sources
language: system
entry: just clippy
types: [rust]
pass_filenames: false
14 changes: 14 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
group_imports = "StdExternalCrate"
wrap_comments = true
use_try_shorthand = true
use_field_init_shorthand = true
reorder_impl_items = true
normalize_doc_attributes = true
normalize_comments = true
imports_granularity = "Module"
match_block_trailing_comma = true
format_strings = true
format_macro_matchers = true
format_code_in_doc_comments = true
fn_single_line = true
condense_wildcard_suffixes = true
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

## Added
Loading

0 comments on commit 8bcd161

Please sign in to comment.