-
Notifications
You must be signed in to change notification settings - Fork 1
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
Johanna Ahlskog
committed
Sep 8, 2023
1 parent
5905b15
commit 8584370
Showing
14 changed files
with
1,263 additions
and
6,799 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"ignorePatterns": ["node_modules", "test"], | ||
"rules": { | ||
"@typescript-eslint/explicit-function-return-type": "warn", | ||
"@typescript-eslint/typedef": [ | ||
"error", | ||
{ | ||
"arrayDestructuring": true, | ||
"arrowCallSignature": true, | ||
"arrowParameter": true, | ||
"callSignature": true, | ||
"memberVariableDeclaration": true, | ||
"parameter": true, | ||
"propertyDeclaration": true, | ||
"objectDestructuring": true, | ||
"variableDeclaration": true, | ||
"variableDeclarationIgnoreFunction": true | ||
} | ||
], | ||
"@typescript-eslint/no-inferrable-types": 0, | ||
"@typescript-eslint/naming-convention": ["error", { "selector": "variableLike", "format": ["camelCase"] }] | ||
} | ||
} | ||
|
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,36 @@ | ||
#!/usr/bin/env sh | ||
if [ -z "$husky_skip_init" ]; then | ||
debug () { | ||
if [ "$HUSKY_DEBUG" = "1" ]; then | ||
echo "husky (debug) - $1" | ||
fi | ||
} | ||
|
||
readonly hook_name="$(basename -- "$0")" | ||
debug "starting $hook_name..." | ||
|
||
if [ "$HUSKY" = "0" ]; then | ||
debug "HUSKY env variable is set to 0, skipping hook" | ||
exit 0 | ||
fi | ||
|
||
if [ -f ~/.huskyrc ]; then | ||
debug "sourcing ~/.huskyrc" | ||
. ~/.huskyrc | ||
fi | ||
|
||
readonly husky_skip_init=1 | ||
export husky_skip_init | ||
sh -e "$0" "$@" | ||
exitCode="$?" | ||
|
||
if [ $exitCode != 0 ]; then | ||
echo "husky - $hook_name hook exited with code $exitCode (error)" | ||
fi | ||
|
||
if [ $exitCode = 127 ]; then | ||
echo "husky - command not found in PATH=$PATH" | ||
fi | ||
|
||
exit $exitCode | ||
fi |
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,3 +1,5 @@ | ||
dist/ | ||
node_modules/ | ||
coverage/ | ||
coverage/ | ||
js_out/ | ||
README.md |
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 |
---|---|---|
|
@@ -8,5 +8,3 @@ | |
"arrowParens": "always", | ||
"singleAttributePerLine": true | ||
} | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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,26 @@ | ||
# How to install linting and format | ||
|
||
1. Run the following commands (be in the root, if you don't have a package.json there, run npm init first to create one): | ||
|
||
```yaml | ||
npm install eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin husky prettier --save-dev | ||
npm pkg set scripts.prepare="husky install" | ||
npm run prepare | ||
``` | ||
|
||
2. Copy files: .eslintrc.json, .prettierignore, .prettierrc and .husky/pre-commit | ||
|
||
3. Add following to script section in package.json: | ||
|
||
```json | ||
"lint": "eslint . --ext .ts", | ||
"lint:fix": "eslint . --fix --ext .ts", | ||
"format:write": "npx prettier -w .", | ||
"format:check": "npx prettier -c .", | ||
``` | ||
|
||
4. Make a commit. You should see that your files are being checked for rule breaks. If it does not work and you are using a Mac, run following command and try a new commit: | ||
|
||
```yaml | ||
chmod ug+x .husky/* | ||
``` |
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,10 +1,18 @@ | ||
# CyDig Controls | ||
# CyDig Azure Task | ||
|
||
This repository contains workflows consisting of CyDig controls. There are 2 different approaches to scan your repositories. The first being on repository level, called *repository scan* (recommended) and the second being on a whole project, called *central scan*. The output of the scans are badges shown below: | ||
This repository contains compliance tasks for Azure. | ||
|
||
![numberOfReviewers](https://img.shields.io/badge/Number%20Of%20Reviewers-1-1eb03b) | ||
![secureScore](https://img.shields.io/badge/Azure%20Security%20Score-100%25-1eb03b) | ||
## Development instructions | ||
|
||
*TODO* | ||
|
||
|
||
By first running ```npm install``` in the root you get the linting and format rules downloaded. So, every time you make a commit, a pre-hook will run to validate the rules (Read more [here](https://github.com/Omegapoint/CydigAzureComplianceAction/blob/main/LinitingAndFormat.md). If there are any violation you will se an error or a warning in the terminal. To fix format warnings run the following command from the **root**: | ||
|
||
```bash | ||
npm run format:write | ||
``` | ||
|
||
## Onboarding of CyDig in a GitHub project | ||
|
||
TODO | ||
*TODO* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.