Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Replace husky with pre-commit #106

Merged
merged 3 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
"require-jsdoc": "off",
"semi": "off"
}
}
}
25 changes: 16 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,32 @@ assignees: fabasoad

---

**Describe the bug**
#### Describe the bug

A clear and concise description of what the bug is.

**Steps to Reproduce**
#### Steps to Reproduce

1. Run '...'
2. See error

**Expected behavior**
#### Expected behavior

A clear and concise description of what you expected to happen.

**Actual behavior**
#### Actual behavior

A clear and concise description of what is happening now.

**Screenshots**
#### Screenshots

If applicable, add screenshots to help explain your problem.

**Technical information (please complete the following information):**
- OS: [e.g. Windows 10 Enterprise v.1909 (OS Build 18363.720)]
- `setup-cobol-action` version [e.g. 1.0.0]
#### Technical information (please complete the following information)

- OS: [e.g. Windows 10 Enterprise v.1909 (OS Build 18363.720)]
- `setup-cobol-action` version [e.g. 1.0.0]

#### Additional context

**Additional context**
Add any other context about the problem here.
10 changes: 0 additions & 10 deletions .github/workflows/security-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ on:
- 'main'

jobs:
snyk_tests:
name: Snyk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_API_TOKEN }}
codeql_tests:
name: CodeQL
runs-on: ubuntu-latest
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/shell-lint.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
${{ runner.os }}-yarn-
- name: Compile
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: yarn install
run: yarn install --ignore-scripts
- name: Lint
run: yarn run lint
- name: Unit tests
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/yaml-lint.yml

This file was deleted.

1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions .husky/commit-msg

This file was deleted.

9 changes: 0 additions & 9 deletions .husky/pre-commit

This file was deleted.

6 changes: 0 additions & 6 deletions .husky/pre-push

This file was deleted.

5 changes: 0 additions & 5 deletions .husky/prepare-commit-msg

This file was deleted.

2 changes: 1 addition & 1 deletion .nycrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"statements": 100,
"extension": ["js"],
"reporter": ["lcov","text","text-summary"]
}
}
77 changes: 77 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
default_stages: ["commit"]
exclude: ^(.gitleaks\.toml|dist/.*\.js|coverage/.*)$
repos:
- repo: local
hooks:
- id: build
name: Build
entry: yarn run build
language: system
pass_filenames: false
verbose: true
- id: test
name: Unit tests
entry: yarn test
language: system
pass_filenames: false
verbose: true
stages: ["push"]
# Security
- repo: https://github.com/Yelp/detect-secrets
rev: v1.3.0
hooks:
- id: detect-secrets
stages: ["commit", "push"]
- repo: https://github.com/zricethezav/gitleaks
rev: v8.8.12
hooks:
- id: gitleaks
stages: ["commit", "push"]
- repo: https://github.com/fabasoad/pre-commit-snyk
rev: v0.0.12
hooks:
- id: snyk-test
stages: ["push"]
# TypeScript
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.20.0
hooks:
- id: eslint
args: ['--fix']
files: \.[jt]sx?$
types: [file]
exclude: ^dist/.*\.js$
# Markdown
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.32.1
hooks:
- id: markdownlint
# Shell
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.8.0.4
hooks:
- id: shellcheck
stages: ["push"]
# Yaml
- repo: https://github.com/adrienverge/yamllint
rev: v1.27.1
hooks:
- id: yamllint
args: ["-c", ".yamllint.yml"]
# Other
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-merge-conflict
- id: check-json
- id: detect-private-key
stages: ["commit", "push"]
- id: end-of-file-fixer
- id: mixed-line-ending
args: ["--fix=lf"]
- id: no-commit-to-branch
- id: trailing-whitespace
ci:
autofix_prs: false
skip: [build, eslint, test]
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
"vercel"
],
"editor.rulers": [ 80 ]
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Setup COBOL (GnuCOBOL)

![GitHub release](https://img.shields.io/github/v/release/fabasoad/setup-cobol-action?include_prereleases) ![Unit Tests](https://github.com/fabasoad/setup-cobol-action/workflows/Unit%20Tests/badge.svg) ![Functional Tests](https://github.com/fabasoad/setup-cobol-action/workflows/Functional%20Tests/badge.svg) ![Security Tests](https://github.com/fabasoad/setup-cobol-action/workflows/Security%20Tests/badge.svg) ![YAML Lint](https://github.com/fabasoad/setup-cobol-action/workflows/YAML%20Lint/badge.svg) ![Shell Lint](https://github.com/fabasoad/setup-cobol-action/workflows/Shell%20Lint/badge.svg) [![Maintainability](https://api.codeclimate.com/v1/badges/84d9008a0dc1a2c6f703/maintainability)](https://codeclimate.com/github/fabasoad/setup-cobol-action/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/84d9008a0dc1a2c6f703/test_coverage)](https://codeclimate.com/github/fabasoad/setup-cobol-action/test_coverage) [![Known Vulnerabilities](https://snyk.io/test/github/fabasoad/setup-cobol-action/badge.svg?targetFile=package.json)](https://snyk.io/test/github/fabasoad/setup-cobol-action?targetFile=package.json)
![GitHub release](https://img.shields.io/github/v/release/fabasoad/setup-cobol-action?include_prereleases) ![Unit Tests](https://github.com/fabasoad/setup-cobol-action/workflows/Unit%20Tests/badge.svg) ![Functional Tests](https://github.com/fabasoad/setup-cobol-action/workflows/Functional%20Tests/badge.svg) ![Security Tests](https://github.com/fabasoad/setup-cobol-action/workflows/Security%20Tests/badge.svg) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/fabasoad/setup-cobol-action/main.svg)](https://results.pre-commit.ci/latest/github/fabasoad/setup-cobol-action/main) [![Maintainability](https://api.codeclimate.com/v1/badges/84d9008a0dc1a2c6f703/maintainability)](https://codeclimate.com/github/fabasoad/setup-cobol-action/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/84d9008a0dc1a2c6f703/test_coverage)](https://codeclimate.com/github/fabasoad/setup-cobol-action/test_coverage) [![Known Vulnerabilities](https://snyk.io/test/github/fabasoad/setup-cobol-action/badge.svg?targetFile=package.json)](https://snyk.io/test/github/fabasoad/setup-cobol-action?targetFile=package.json)

This action sets up a [GnuCOBOL](https://en.wikipedia.org/wiki/COBOL) programming language. Currently supports Linux Ubuntu only.

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"main": "dist/index.js",
"scripts": {
"build": "ncc build -m src/index.js",
"lint:md": "markdownlint --config .markdownlint.yml '**/*.md'",
"lint:es": "eslint src __tests__",
"lint": "yarn run lint:md && yarn run lint:es",
"postinstall": "yarn husky install",
"lint": "eslint src __tests__",
"postinstall": "pre-commit install --hook-type pre-commit && pre-commit install --hook-type pre-push",
"test": "nyc mocha __tests__"
},
"repository": {
Expand All @@ -35,9 +33,6 @@
"chai": "4.3.6",
"eslint": "8.9.0",
"eslint-config-google": "0.14.0",
"git-branch-is": "4.0.0",
"husky": "7.0.4",
"markdownlint-cli": "0.31.1",
"mocha": "9.2.0",
"mocha-param": "2.0.1",
"nyc": "15.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/install-cobol-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ sudo chmod +x /home/cobol/cobol-unit-test/compile
sudo chmod +x /home/cobol/cobol-unit-test/upload/ZUTZCPC

# shellcheck disable=SC2086
echo "/home/cobol" >> $GITHUB_PATH
echo "/home/cobol" >> $GITHUB_PATH
Loading