-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added apache 2.0 license to all crates * semgrep and dprint for code formatting * cargo-deny for managing crates licenses Signed-off-by: Hergy Fongue <hergy.fongue@ext.markant.com>
- Loading branch information
Showing
19 changed files
with
189 additions
and
16 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,52 @@ | ||
name: linter | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
inputs: | ||
commit_sha: | ||
description: Git commit sha, on which, to run this workflow | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
lint_commits: | ||
name: Lint Commit Messages | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Check Commit Lint | ||
uses: wagoid/commitlint-github-action@v5.0.0 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
lint_check: | ||
name: Rust - lint_${{ matrix.lint_projects }} | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
lint_projects: | ||
- cargo_fmt_check | ||
- cargo_clippy | ||
- cargo_deny | ||
- cargo_toml_files | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
with: | ||
ref: ${{ github.event.inputs.commit_sha }} | ||
- name: Run lint ${{ matrix.lint_projects }} | ||
run: make -f Makefile lint_${{ matrix.lint_projects }} | ||
|
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,59 @@ | ||
build_docs: | ||
cargo doc --locked --no-deps | ||
build_examples: | ||
cargo --locked build --examples | ||
build: | ||
cargo build --locked | ||
build_release: | ||
cargo --locked build --release | ||
build_release_%: | ||
cargo --locked build --release --package $* | ||
build_%: | ||
cargo build --locked --package $* | ||
|
||
check: | ||
cargo check --locked | ||
check_no_std: | ||
cargo --version | ||
cargo check --locked --target thumbv7em-none-eabihf -p ockam --no-default-features --features 'no_std alloc software_vault' | ||
# no_std example project | ||
cd examples/rust/example_projects/no_std | ||
cargo check --example hello | ||
check_cargo_update: | ||
cargo --version | ||
# TODO: uncomment when tauri version is updated | ||
# rm -rf Cargo.lock | ||
# cargo update | ||
# cargo check --locked | ||
|
||
lint: lint_cargo_fmt_check lint_cargo_deny lint_cargo_clippy | ||
|
||
lint_cargo_fmt_check: | ||
cargo fmt --all -- --check | ||
|
||
lint_cargo_deny: | ||
cargo deny --all-features \ | ||
check licenses advisories\ | ||
--config=tools/cargo-deny/deny.toml | ||
|
||
lint_cargo_clippy: | ||
cargo clippy --no-deps --all-targets -- -D warnings | ||
|
||
lint_cargo_toml_files: | ||
dprint check --config tools/dprint/dprint.json | ||
|
||
clean: | ||
cargo clean | ||
clean_%: | ||
cargo clean --package $* | ||
|
||
very_clean: | ||
rm -rf ../../target | ||
|
||
format: | ||
cargo fmt --all | ||
|
||
.PHONY: | ||
check \ | ||
lint lint_cargo_fmt_check lint_cargo_deny lint_cargo_clippy lint_cargo_toml_files lint_cargo_readme lint_cargo_readme_% lint_cargo_toml_files \ | ||
clean clean_% very_clean format |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
[workspace] | ||
|
||
members = [ | ||
"bindings", | ||
"factory", | ||
"types", | ||
"zz_artifact", | ||
"zz_branch", | ||
"zz_build", | ||
"zz_change", | ||
"zz_environment", | ||
"zz_incident", | ||
"zz_pipeline", | ||
"zz_repository", | ||
"zz_service", | ||
"zz_task" | ||
] | ||
"bindings", | ||
"factory", | ||
"types", | ||
"zz_artifact", | ||
"zz_branch", | ||
"zz_build", | ||
"zz_change", | ||
"zz_environment", | ||
"zz_incident", | ||
"zz_pipeline", | ||
"zz_repository", | ||
"zz_service", | ||
"zz_task", | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# cargo-deny is a cargo plugin that lets you lint your project's dependency graph | ||
# to ensure all your dependencies conform to your expectations and requirements. | ||
[bans] | ||
multiple-versions = "deny" | ||
# Dependencies cannot be specified with the "*" version. | ||
wildcards = "deny" | ||
|
||
[licenses] | ||
unlicensed = "deny" | ||
copyleft = "deny" | ||
confidence-threshold = 0.95 | ||
allow = [ | ||
"MIT", | ||
"Apache-2.0", | ||
] | ||
exceptions = [] | ||
|
||
[advisories] | ||
unmaintained = "deny" | ||
vulnerability = "deny" | ||
#Determines what happens when a crate with a version that has been yanked from its source registry is encountered. | ||
yanked = "warn" | ||
ignore = [] | ||
# Users who require or prefer Git to use SSH cloning instead of HTTPS, | ||
# such as implemented via "insteadOf" rules in Git config, can still | ||
# successfully fetch advisories with this enabled. | ||
# | ||
# See also: | ||
# https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli | ||
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html#the-git-fetch-with-cli-field-optional | ||
# https://github.com/EmbarkStudios/cargo-deny/pull/420 | ||
git-fetch-with-cli = true |
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 @@ | ||
{ | ||
"includes": [ | ||
"**/Cargo.toml" | ||
], | ||
"plugins": [ | ||
"https://plugins.dprint.dev/toml-0.5.4.wasm" | ||
] | ||
} |
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,9 @@ | ||
[package] | ||
name = "types" | ||
version = "0.1.0" | ||
edition = "2021" | ||
license = "MIT" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
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,3 @@ | ||
fn main() { | ||
println!("Hello, world!"); | ||
} |
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
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
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
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
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