-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
3,187 additions
and
0 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,6 @@ | ||
# https://doc.rust-lang.org/cargo/reference/config.html | ||
|
||
[profile.release] | ||
opt-level = 3 | ||
lto = true | ||
codegen-units = 1 |
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,6 @@ | ||
# Right now we just use the defaults. This file exists should we | ||
# want to change that, and to indicate to contributors that they | ||
# might want to run clippy. | ||
# | ||
# See https://rust-lang.github.io/rust-clippy/master/index.html for | ||
# the complete list of lints. |
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,39 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install latest nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
components: rustfmt | ||
|
||
- name: Check the code formatting with rustfmt | ||
run: cargo +nightly fmt -- --check | ||
|
||
- name: Install latest stable | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
default: true | ||
components: clippy | ||
|
||
- name: Ensure there are no warnings with Clippy | ||
run: cargo clippy --all-features -- -Dwarnings | ||
|
||
- name: Run tests | ||
run: cargo test --all-features |
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,88 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
release: | ||
name: Release ${{ matrix.target }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- os: ubuntu-latest | ||
target: aarch64-unknown-linux-gnu | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-musl | ||
- os: ubuntu-latest | ||
target: aarch64-unknown-linux-musl | ||
- os: macOS-latest | ||
target: x86_64-apple-darwin | ||
- os: macOS-latest | ||
target: aarch64-apple-darwin | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
- os: windows-latest | ||
target: aarch64-pc-windows-msvc | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
target: ${{ matrix.target }} | ||
|
||
- name: Build target | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
use-cross: true | ||
command: build | ||
args: --release --target ${{ matrix.target }} | ||
|
||
- name: Package | ||
shell: bash | ||
run: | | ||
tar czvf intelli-shell-${{ matrix.target }}.tar.gz intelli-shell.sh -C target/${{ matrix.target }}/release intelli-shell | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: intelli-shell-${{ matrix.target }}.tar.gz | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
publish: | ||
name: Publish to crates | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Publish | ||
run: cargo publish --token ${CRATES_TOKEN} | ||
env: | ||
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} |
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,109 @@ | ||
### Linux ### | ||
*~ | ||
|
||
# temporary files which can be created if a process still has a handle open of a deleted file | ||
.fuse_hidden* | ||
|
||
# KDE directory preferences | ||
.directory | ||
|
||
# Linux trash folder which might appear on any partition or disk | ||
.Trash-* | ||
|
||
# .nfs files are created when an open file is removed but is still being accessed | ||
.nfs* | ||
|
||
### macOS ### | ||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
# iCloud generated files | ||
*.icloud | ||
|
||
### Windows ### | ||
# Windows thumbnail cache files | ||
Thumbs.db | ||
Thumbs.db:encryptable | ||
ehthumbs.db | ||
ehthumbs_vista.db | ||
|
||
# Dump file | ||
*.stackdump | ||
|
||
# Folder config file | ||
[Dd]esktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msix | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
### VisualStudioCode ### | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
!.vscode/*.code-snippets | ||
|
||
# Ignore code-workspaces | ||
*.code-workspace | ||
|
||
# Local History for Visual Studio Code | ||
.history/ | ||
.history | ||
.ionide | ||
|
||
# Built Visual Studio Code Extensions | ||
*.vsix | ||
|
||
### Rust ### | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
debug | ||
target | ||
|
||
# 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 | ||
|
||
### Local ### | ||
.env |
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,19 @@ | ||
max_width = 120 | ||
newline_style = "Unix" | ||
use_field_init_shorthand = true | ||
use_try_shorthand = true | ||
|
||
# Unstable features below | ||
unstable_features = true | ||
version = "Two" | ||
comment_width = 120 | ||
error_on_line_overflow = true | ||
format_code_in_doc_comments = true | ||
format_macro_bodies = true | ||
format_macro_matchers = true | ||
format_strings = true | ||
imports_granularity = "Crate" | ||
group_imports = "StdExternalCrate" | ||
reorder_impl_items = true | ||
normalize_doc_attributes = true | ||
wrap_comments = 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,14 @@ | ||
# https://taplo.tamasfe.dev/configuration/formatter-options.html | ||
|
||
[formatting] | ||
align_entries = false | ||
trailing_newline = true | ||
column_width = 120 | ||
|
||
[[rule]] | ||
#include = ["Cargo.toml", "**/Cargo.toml"] | ||
keys = ["dependencies", "dev-dependencies"] | ||
|
||
[rule.formatting] | ||
reorder_keys = true | ||
align_entries = 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,12 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. | ||
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp | ||
// List of extensions which should be recommended for users of this workspace. | ||
"recommendations": [ | ||
"rust-lang.rust-analyzer", | ||
"serayuzgur.crates", | ||
"tamasfe.even-better-toml", | ||
], | ||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace. | ||
"unwantedRecommendations": [] | ||
} |
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,20 @@ | ||
{ | ||
"editor.rulers": [ | ||
120 | ||
], | ||
// https://rust-analyzer.github.io/manual.html | ||
"rust-analyzer.check.command": "clippy", | ||
"rust-analyzer.rustfmt.extraArgs": [ | ||
"+nightly" | ||
], | ||
"rust-analyzer.procMacro.ignored": { | ||
"async-trait": [ | ||
"async_trait" | ||
], | ||
}, | ||
"[rust]": { | ||
"editor.defaultFormatter": "rust-lang.rust-analyzer" | ||
}, | ||
"evenBetterToml.taplo.configFile.enabled": true, | ||
"evenBetterToml.taplo.configFile.path": ".taplo.toml" | ||
} |
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,47 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "cargo", | ||
"command": "build", | ||
"problemMatcher": [ | ||
"$rustc" | ||
], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"label": "rust: cargo build" | ||
}, | ||
{ | ||
"type": "cargo", | ||
"command": "test", | ||
"problemMatcher": [ | ||
"$rustc" | ||
], | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true | ||
}, | ||
"label": "rust: cargo test" | ||
}, | ||
{ | ||
"type": "cargo", | ||
"command": "clean", | ||
"problemMatcher": [ | ||
"$rustc" | ||
], | ||
"label": "rust: cargo clean" | ||
}, | ||
{ | ||
"type": "cargo", | ||
"command": "run", | ||
"problemMatcher": [ | ||
"$rustc" | ||
], | ||
"label": "rust: cargo run" | ||
} | ||
] | ||
} |
Oops, something went wrong.