Browse Source

Fixing azure pipelines to flake everything in master

Vince Salvino 5 years ago
parent
commit
6be210a550
1 changed files with 6 additions and 6 deletions
  1. 6 6
      ci/run_flake8.ps1

+ 6 - 6
ci/run_flake8.ps1

@@ -1,16 +1,16 @@
 $ExitCode = 0
-# If we're on master then flake8 everything.
-$GitBranch = git rev-parse --abbrev-ref HEAD
-if ( $GitBranch -eq "master") {
-    flake8 coderedcms testproject
+$GitDiff = git diff origin/master
+# If there is no diff between master, then flake8 everything.
+if ( $GitDiff -eq $null ) {
+    flake8 .
     if ($LastExitCode -ne 0) { $ExitCode = $LastExitCode }
 }
 # Else flake8 just the diff.
 else {
-    git diff origin/master | flake8 --diff
+    Write-Output $GitDiff | flake8 --diff
     if ($LastExitCode -ne 0) { $ExitCode = $LastExitCode }
     # If the project_template changed, then flake8 the testproject too.
-    $GitDiffTempl = git diff origin/master | Select-String -Pattern "^diff .*/project_template/.*"
+    $GitDiffTempl = Write-Output $GitDiff | Select-String -Pattern "^diff .*/project_template/.*"
     if ( $GitDiffTempl -ne $null ) {
         flake8 testproject
         if ($LastExitCode -ne 0) { $ExitCode = $LastExitCode }