Skip to content

Commit

Permalink
build: adds commitment, husky, ci gitleaks secret scanner (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ephigenia authored Dec 27, 2021
1 parent 2a212aa commit 766f065
Show file tree
Hide file tree
Showing 12 changed files with 2,145 additions and 36 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-angular"]
}
5 changes: 0 additions & 5 deletions .eslintrc

This file was deleted.

5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"plugin:unicorn/all"
]
}
11 changes: 11 additions & 0 deletions .github/workflows/gitleaks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: gitleaks

on: [push,pull_request]

jobs:
gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: gitleaks-action
uses: zricethezav/gitleaks-action@master
27 changes: 5 additions & 22 deletions .github/workflows/default.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,24 @@
name: default
name: lint

on: [push]

env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

jobs:
lint:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
# Full git history is needed to get a proper list of changed files
# within `super-linter`
fetch-depth: 0
- uses: github/super-linter/slim@v4
env:
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: true
VALIDATE_JAVASCRIPT_ES: true
VALIDATE_EDITORCONFIG: true
VALIDATE_YAML: true
VALIDATE_BASH: true
VALIDATE_BASH: truea
VALIDATE_BASH_EXEC: true
FILTER_REGEX_EXCLUDE: CHANGELOG.md

test:
name: test
runs-on: ubuntu-latest
needs: [lint]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci --no-production
- run: npm test
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: test

on: [push]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci --no-production
- run: npm test
19 changes: 19 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env sh

RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NO_COLOR='\033[0m'

if [ ! -f "$(dirname "$0")/_/husky.sh" ]; then
printf "%bERROR%b: Pre-commit hooks not configured...\n" "$RED" "$NO_COLOR"
printf '* To install pre-commit hooks run: %bnpm install%b\n' "$BLUE" "$NO_COLOR"
printf '* To commit without pre-commit run: %bgit commit --no-verify%b\n' "$BLUE" "$NO_COLOR"
printf '\n'
fi

# shellcheck disable=SC1091
. "$(dirname "$0")/_/husky.sh"

printf "%b>>>%b Checking commit lint guidelines types...\n" "$GREEN" "$NO_COLOR"
npx --no-install commitlint --edit "${1}"
19 changes: 19 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NO_COLOR='\033[0m'

if [ ! -f "$(dirname "$0")/_/husky.sh" ]; then
printf "%bERROR%b: Pre-commit hooks not configured...\n" "$RED" "$NO_COLOR"
printf '* To install pre-commit hooks run: %bnpm install%b\n' "$BLUE" "$NO_COLOR"
printf '* To commit without pre-commit run: %bgit commit --no-verify%b\n' "$BLUE" "$NO_COLOR"
printf '\n'
fi

# shellcheck disable=SC1091
. "$(dirname "$0")/_/husky.sh"

printf "%b>>>%b lint...\n" "$GREEN" "$NO_COLOR"
npm run lint -s
22 changes: 22 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NO_COLOR='\033[0m'

if [ ! -f "$(dirname "$0")/_/husky.sh" ]; then
printf "%bERROR%b: Pre-commit hooks not configured...\n" "$RED" "$NO_COLOR"
printf '* To install pre-commit hooks run: %bnpm install%b\n' "$BLUE" "$NO_COLOR"
printf '* To commit without pre-commit run: %bgit commit --no-verify%b\n' "$BLUE" "$NO_COLOR"
printf '\n'
fi

# shellcheck disable=SC1091
. "$(dirname "$0")/_/husky.sh"

printf "%b>>>%b lint...\n" "$GREEN" "$NO_COLOR"
npm run lint -s

printf "%b>>>%b test...\n" "$GREEN" "$NO_COLOR"
npm test
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Command Line Interface ([CLI](https://en.wikipedia.org/wiki/Command-line_interfa

- [x] get current balance (`kontist-cli balance`, returns availableBalance)
- [ ] make transaction `kontist-cli` … in progress
- [ ] standing order(s)
- [ ] list
- [ ] make standing order (https://kontist.dev/sdk/#create-a-standing-order)
- [ ] update standing order (https://kontist.dev/sdk/#updating-a-standing-order)
- [ ] delete standing order
- [ ] make timed transaction https://kontist.dev/sdk/#create-a-timed-order
- [x] money format?
- [x] currency?
Expand Down
Loading

0 comments on commit 766f065

Please sign in to comment.