From 9557eab7de3ee2e9c5eecf22f82696368fe5731f Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Fri, 9 Apr 2021 11:33:03 +0300 Subject: [PATCH] Removed validation-scripts --- ci_scripts/.gitignore | 2 -- ci_scripts/README.md | 8 ------ ci_scripts/install_requirements.ps1 | 5 ---- ci_scripts/requirements.txt | 6 ----- ci_scripts/validate.ps1 | 39 ----------------------------- 5 files changed, 60 deletions(-) delete mode 100644 ci_scripts/.gitignore delete mode 100644 ci_scripts/README.md delete mode 100644 ci_scripts/install_requirements.ps1 delete mode 100644 ci_scripts/requirements.txt delete mode 100644 ci_scripts/validate.ps1 diff --git a/ci_scripts/.gitignore b/ci_scripts/.gitignore deleted file mode 100644 index 67f93fcdc..000000000 --- a/ci_scripts/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -./validation-env -./flake8_warnings.txt diff --git a/ci_scripts/README.md b/ci_scripts/README.md deleted file mode 100644 index 09330d298..000000000 --- a/ci_scripts/README.md +++ /dev/null @@ -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` diff --git a/ci_scripts/install_requirements.ps1 b/ci_scripts/install_requirements.ps1 deleted file mode 100644 index de42d8599..000000000 --- a/ci_scripts/install_requirements.ps1 +++ /dev/null @@ -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 diff --git a/ci_scripts/requirements.txt b/ci_scripts/requirements.txt deleted file mode 100644 index 2b7db1909..000000000 --- a/ci_scripts/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -flake8 -pytest -dlint -isort -coverage -black diff --git a/ci_scripts/validate.ps1 b/ci_scripts/validate.ps1 deleted file mode 100644 index d85da6a2a..000000000 --- a/ci_scripts/validate.ps1 +++ /dev/null @@ -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