]> granicus.if.org Git - graphviz/commitdiff
CI: add a job for enforcing CMake file formatting
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 31 Jan 2022 02:34:12 +0000 (13:34 +1100)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 1 Feb 2022 04:29:03 +0000 (15:29 +1100)
This should hopefully reduce the mental load on MR reviewers going forwards.

.gitlab-ci.yml
requirements.txt

index 292e8abd6dd1cd9ef921582feb5eee0b3f742584..480d22dfe336eea9f481c3ae317060bba8d43534 100644 (file)
@@ -1473,6 +1473,16 @@ docker_push_ubuntu-21.10:
   needs:
     - docker_build_ubuntu-21.10
 
+lint_cmake_format:
+  image: "$CI_REGISTRY_IMAGE/ubuntu-21.10:$CI_COMMIT_SHA"
+  stage: test
+  needs:
+    - docker_build_ubuntu-21.10
+  script:
+    - git ls-files -z -- '**/CMakeLists.txt' '**/*.cmake' '**/*.cmake.in' | xargs -0 -- python3 -m cmakelang.lint
+  except:
+    - tags
+
 lint_pylint:
   image: "$CI_REGISTRY_IMAGE/ubuntu-21.10:$CI_COMMIT_SHA"
   stage: test
index 81c7356c8918427537f88684bcb11a05bce28dc5..8ade03ac0fbfc9e6dfbef4eada329a403b832a7d 100644 (file)
@@ -1,2 +1,3 @@
+cmakelang==0.6.13
 pylint==2.11.1
 pytest==6.2.4