forked from p15670423/monkey
Removed validation-scripts
This commit is contained in:
parent
f9d8584910
commit
9557eab7de
|
@ -1,2 +0,0 @@
|
|||
./validation-env
|
||||
./flake8_warnings.txt
|
|
@ -1,8 +0,0 @@
|
|||
# About
|
||||
|
||||
Run this script to validate your code locally and auto fix/format the problems before pushing.
|
||||
|
||||
# Usage
|
||||
|
||||
You've got to manually download swimm for swimm validation.
|
||||
run from `infection_monkey` directory: `powershell .\ci_scripts\validate.ps1`
|
|
@ -1,5 +0,0 @@
|
|||
python -m venv validation-env
|
||||
.\validation-env\Scripts\activate.ps1
|
||||
python -m pip install -r .\requirements.txt
|
||||
npm i -g eslint
|
||||
deactivate
|
|
@ -1,6 +0,0 @@
|
|||
flake8
|
||||
pytest
|
||||
dlint
|
||||
isort
|
||||
coverage
|
||||
black
|
|
@ -1,39 +0,0 @@
|
|||
.\ci_scripts\validation-env\Scripts\activate.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
python -m pip install -r monkey/monkey_island/requirements.txt
|
||||
python -m pip install -r monkey/infection_monkey/requirements.txt
|
||||
flake8 ./monkey --config ./ci_scripts/flake8_syntax_check.cfg
|
||||
flake8 ./monkey --exit-zero --config ./ci_scripts/flake8_linter_check.cfg | Out-File -FilePath .\ci_scripts\flake8_warnings.txt
|
||||
Get-Content -Path .\ci_scripts\flake8_warnings.txt
|
||||
$PYTHON_WARNINGS_AMOUNT_UPPER_LIMIT = 80
|
||||
if ((Get-Item -Path .\ci_scripts\flake8_warnings.txt | Get-Content -Tail 1) -gt $PYTHON_WARNINGS_AMOUNT_UPPER_LIMIT){
|
||||
"Too many python linter warnings! Failing this build. Lower the amount of linter errors in this and try again. "
|
||||
exit
|
||||
}
|
||||
python -m isort ./monkey -c --settings-file ./ci_scripts/isort.cfg
|
||||
if (!$?) {
|
||||
$confirmation = Read-Host "Isort found errors. Do you want to attmpt to fix them automatically? (y/n)"
|
||||
if ($confirmation -eq 'y') {
|
||||
python -m isort ./monkey --settings-file ./ci_scripts/isort.cfg
|
||||
}
|
||||
}
|
||||
Push-Location -Path ./monkey
|
||||
python ./monkey_island/cc/environment/set_server_config.py testing
|
||||
python -m pytest
|
||||
$lastCommandSucceeded = $?
|
||||
python ./monkey_island/cc/environment/set_server_config.py restore
|
||||
Pop-Location
|
||||
|
||||
if (!$lastCommandSucceeded) {
|
||||
exit
|
||||
}
|
||||
|
||||
Push-Location -Path .\monkey\monkey_island\cc\ui
|
||||
eslint ./src -c ./.eslintrc
|
||||
Pop-Location
|
||||
|
||||
swimm verify
|
||||
|
||||
Write-Host "Script finished. Press any key to continue"
|
||||
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');
|
||||
deactivate
|
Loading…
Reference in New Issue