Skip to content

Commit

Permalink
Add initial structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteOtter committed Jul 2, 2024
1 parent e8181ed commit ae450e2
Show file tree
Hide file tree
Showing 17 changed files with 253 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug report
about: Found an issue? Please let us know!
title: "[BUG:]"
labels: ''
assignees: ''

---

# Found an issue? Please let us know!

<!-- Please provide a description of the bug you found here -->

### Please tick the applicable box(es) regarding the kind of bug you found:

<!-- Please note that bugs regarding the CLI and the core functionality of Nester receive priority. -->

- [ ] Broken feature
- [ ] Wrong documentation
- [ ] Broken dependency

### Steps to reproduce

<!-- Please provide a detailed description of steps we have to take to reproduce your issue.
Please be aware that bugs which cannot be reproduced cannot be fixed.
Use these snippets as reference:
1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
4. See error
-->

### Additional context

<!--
Use this section to provide us with additional context.<br>
Especially screenshots are a useful tool to let us reproduce and find issues more quickly.
-->
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Feature Request
about: You would like us to add something? Add it here!
title: "[FR:]"
labels: ''
assignees: ''

---
# You would like to suggest a new feature?

<!-- Please provide a description of what you want to be added.
Please note that requests for new languages can only be processed if they have a standardized project layout we can use as reference.
Linking to official language documentation with a diagram or description of said layout would also be very helpful. Thank you.
-->

***
## Is your feature request related to a problem you had? Please describe:

<!-- Description -->

## Additional context

<!-- Please provide additional context like drafts or screenshots here. -->
Empty file.
22 changes: 22 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
rust:
- **/**/*.rs

dependencies:
- Cargo.toml
- **/Cargo.toml
- **/Cargo.lock
- Cargo.lock

documentation:
- docs/**
- README.md
- LICENSE
- CODE_OF_CONDUCT.md
- CONTRIBUTING

code-quality:
- .pre-commit-hooks/*
- .pre-commit-config.yaml

maintenance:
- .github/*
26 changes: 26 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Dependency Vulnerability Audit

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * 0'

jobs:
vulnerability_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: audit
args: --color always
16 changes: 16 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Labeler
on: [pull_request_target]

jobs:
label:

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write


steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
23 changes: 23 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Style checking

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
rustfmt:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Run cargo fmt
run: cargo fmt -- --check

- name: Run cargo clippy
run: cargo clippy
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Execute Tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
cargo-test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Run Cargo test
run: cargo test --verbose
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ Cargo.lock

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb


# Added by cargo

/target
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repos:
- repo: local
hooks:
- id: rustfmt
name: autofmt
entry: .pre-commit-hooks/rustfmt.sh
language: script
files: \.rs$

- id: clippy
name: clippy_linter
entry: .pre-commit-hooks/clippy.sh
language: script
files: \.rs$
9 changes: 9 additions & 0 deletions .pre-commit-hooks/clippy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

# Run cargo clippy mainly for dead code analysis.

cargo clippy -- --Dwarnings 2> /dev/null
clippy_exit_code=$?
if [ $clippy_exit_code != 0 ]; then
echo -e "\e[31mYour code seems to contain style violations! Run cargo clippy before committing!\e[0m" ; exit 1
fi
10 changes: 10 additions & 0 deletions .pre-commit-hooks/rustfmt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

# Run rustfmt on all staged files to check for formatting errors.

STAGED=$(git diff --name-only --cached | grep '.*\.rs')
if ! [ "$STAGED" = '' ]; then
rustfmt --check "$STAGED" || {
echo -e "\e[31mYour code is not formatted correctly! Please run rustfmt on all staged files before committing!\e[0m" ; exit 1
}
fi
4 changes: 4 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file will automatically ping all mentioned persons or teams
# when a PR changes files at the specified locations.

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

[dependencies]
14 changes: 14 additions & 0 deletions isotomachine/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pub fn add(left: usize, right: usize) -> usize {
left + right
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
6 changes: 6 additions & 0 deletions isototest/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "isototest"
version = "0.1.0"
edition = "2021"

[dependencies]
14 changes: 14 additions & 0 deletions isototest/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pub fn add(left: usize, right: usize) -> usize {
left + right
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}

0 comments on commit ae450e2

Please sign in to comment.