Skip to content

Commit

Permalink
feat(config): add call config.toml logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bingryan committed Aug 30, 2021
1 parent 62a66db commit cd55b87
Show file tree
Hide file tree
Showing 27 changed files with 843 additions and 508 deletions.
12 changes: 3 additions & 9 deletions .editorconfig
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
root = true
[*.rs]
[*]
indent_style=tab
indent_size=tab
tab_width=4
end_of_line=lf
charset=utf-8
trim_trailing_whitespace=true
max_line_length=100
max_line_length=120
insert_final_newline=true

[*.yml]
indent_style=space
indent_size=2
tab_width=8
end_of_line=lf

[*.sh]
[*.{yml,yaml}]
indent_style=space
indent_size=2
tab_width=8
Expand Down
57 changes: 57 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# How to Contribute

We welcome any kind of contributions. Whether you are reporting a bug, coding a feature or correcting a typo. Every effort counts; and all contributions are greatly appreaciated.

### Testing Code

To run all tests, run the following command.

```sh
cargo test --all

```


### Linting Code

### Debugging Code

### Commit Messages

Use a [conventional](https://github.com/ajoslin/conventional-changelog/blob/a5505865ff3dd710cf757f50530e73ef0ca641da/conventions/angular.md) changelog format so the changelog can be updated automatically using [clog](https://github.com/clog-tool/clog-cli)

* Please format your commit subject line using the following format: `TYPE(COMPONENT): MESSAGE` where `TYPE` is one of the following:
- `feat` - A new feature of an existing API
- `imp` - An improvement to an existing feature/API
- `perf` - A performance improvement
- `docs` - Changes to documentation only
- `tests` - Changes to the testing framework or tests only
- `fix` - A bug fix
- `refactor` - Code functionality doesn't change, but underlying structure may
- `style` - Stylistic changes only, no functionality changes
- `wip` - A work in progress commit (Should typically be `git rebase`'ed away)
- `chore` - Catch all or things that have to do with the build system, etc
- `examples` - Changes to existing example, or a new example
* The `COMPONENT` is optional, and may be a single file, directory, or logical component. Parenthesis can be omitted if you are opting not to use the `COMPONENT`.

### Tests and Documentation

1. Create tests for your changes
2. **Ensure the tests are passing.** Run the tests (`cargo test --all`), alternatively `just run-tests` if you have `just` installed.
3. **Optional** Run the lints.
4. Ensure your changes contain documentation if adding new APIs or features.

### Preparing the PR


1. `git rebase` into concise commits and remove `--fixup`s or `wip` commits (`git rebase -i HEAD~NUM` where `NUM` is number of commits back to start the rebase)
2. Push your changes back to your fork (`git push origin $your-branch`)
3. Create a pull request against `master`! (You can also create the pull request first, and we'll merge when ready. This a good way to discuss proposed changes.)

### Goals

* Remain backwards compatible when possible.
Backward compatibility is not critical since projects do not depend on Rust Starter. But it's a good idea to have stable features and usage.
* Reduce dependencies.
* Follow best practices.
* Ease of use and customization.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
Please use the following template to assist with creating an issue and to ensure a speedy resolution. If an area is not applicable, feel free to delete the area or mark with `N/A`
-->

### Rust Version

* Use the output of `rustc -V`

### Affected Version of clap

* Can be found in Cargo.lock of your project (i.e. `grep clap Cargo.lock`)

### Bug or Feature Request Summary


### Expected Behavior Summary


### Actual Behavior Summary


### Steps to Reproduce the issue


### Sample Code or Link to Sample Code


### Debug output
12 changes: 12 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Security audit

on: [push, pull_request]

jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: omarabid-forks/rs-audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
79 changes: 79 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout Source
id: checkout-source
uses: actions/checkout@v2
- name: Set variables
id: vars
run: |
echo "::set-output name=package_name::$(sed -En 's/name[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p' Cargo.toml | head -1)"
echo "::set-output name=package_version::$(sed -En 's/version[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p' Cargo.toml | head -1)"
- run: |
echo "${{steps.vars.outputs.package_name}}"
echo "${{steps.vars.outputs.package_version}}"
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build
id: build-release
run: cargo build --release

- name: Zip release
id: zip-release
run: zip -j build.zip target/release/call

- name: Artifact Production
id: create-artifact
uses: actions/upload-artifact@v1
with:
name: build
path: build.zip

- name: Remove Same Release
uses: omarabid-forks/action-rollback@stable
continue-on-error: true
with:
tag: ${{ steps.vars.outputs.package_version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
id: create-release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{steps.vars.outputs.package_version}}
release_name: Version ${{steps.vars.outputs.package_version}}
body: ${{steps.vars.outputs.package_name}} - ${{steps.vars.outputs.package_version}}
draft: false
prerelease: false

- name: Upload Artifact
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: build.zip
asset_name: build.zip
asset_content_type: application/zip

- uses: omarabid-forks/purge-artifacts@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
expire-in: 0
33 changes: 33 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on: [push]

name: Code Coverage

jobs:
codecov:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install stable toolchain
uses: omarabid-forks/rs-toolchain@v1
with:
toolchain: stable
override: true

- name: Run cargo-tarpaulin
uses: omarabid-forks/[email protected]
with:
version: '0.9.0'
args: '-- --test-threads 1'

- name: Upload to codecov.io
uses: omarabid-forks/[email protected]
with:
token: ${{secrets.CODECOV_TOKEN}}

- name: Archive code coverage results
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: cobertura.xml
14 changes: 14 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Linter

on: [push, pull_request]

jobs:
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: rustup component add clippy
- uses: omarabid-forks/rs-clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
26 changes: 26 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Tests

on: [push, pull_request]

jobs:
test:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: omarabid-forks/rs-toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Run cargo test
uses: omarabid-forks/rs-cargo@v1
with:
command: test
10 changes: 10 additions & 0 deletions .github/workflows/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
on: push
name: TOC Generator
jobs:
generateTOC:
name: TOC Generator
runs-on: ubuntu-latest
steps:
- uses: omarabid-forks/toc-generator@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 19 additions & 2 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/target
# Generated by Cargo
# will have compiled files and executables
**/target/
# These are backup files generated by rustfmt
**/*.rs.bk

.DS_Store

# The cache for docker container dependency
.cargo

# The cache for chain data in container
.local

# direnv cache
.direnv

.idea/
Call.yml
**/expand.rs
.local/Call.yml
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
exclude: '^docs/.github/.local'
repos:
- repo: https://github.com/doublify/pre-commit-rust
rev: master
hooks:
- id: fmt
- id: cargo-check
3 changes: 2 additions & 1 deletion .rustfmt.toml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
reorder_imports = true
hard_tabs = true
max_width = 120
wrap_comments = true
comment_width = 100
wrap_comments = true
8 changes: 4 additions & 4 deletions .travis.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ rust:
- stable
- beta
- nightly
jobs:
allow_failures:
- rust: nightly
fast_finish: true
script:
- cargo build --verbose
- cargo test --verbose
- cargo doc
30 changes: 0 additions & 30 deletions CHANGELOG.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,30 +0,0 @@
## 0.2.0 (June 6, 2021)

#### FEATURES:

* add template support

#### IMPROVEMENTS:

#### BUG FIXES:



#### BREAKING CHANGES:

## 0.1.2 (May 6, 2021)

#### FEATURES:

#### IMPROVEMENTS:

#### BUG FIXES:

* Fix bin name bug

#### BREAKING CHANGES:


## 0.1.0 (May 5, 2021)

### First release
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

- Create an `issue and describe` your idea
- Fork it!
- Create your feature branch: git checkout -b my-new-feature
- Create your feature branch: git checkout -b feat-some-idea
- Add files to the staging area : `git add .`
- Commit your changes: `git commit -am 'Add some feature'`
- Push to the branch: `git push origin my-new-feature`
- Submit a pull request to main branch

- Push to the branch: `git push origin feat-some-idea`
- Submit a pull request to master branch
Loading

0 comments on commit cd55b87

Please sign in to comment.