]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
gitlabci: fix lint:luacheck
authorTomas Krizek <tomas.krizek@nic.cz>
Thu, 21 Feb 2019 15:51:27 +0000 (16:51 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 12 Mar 2019 09:43:36 +0000 (10:43 +0100)
.gitlab-ci.yml
daemon/lua/meson.build
meson.build

index c5e4b251933947ff397501ca04346a3dd730674e..358ef4b6c6ba007f504bb55d8aced4d455dfd799 100644 (file)
@@ -150,15 +150,12 @@ lint:pedantic:
       -Wpedantic -Wno-newline-eof -Wno-gnu-zero-variadic-macro-arguments -Wno-gnu-folding-constant'
     - ninja -C build_pedantic_clang
 
-lint:lua:
+lint:luacheck:
+  <<: *test_nodep
   stage: test
-  except:
-    - master
-  dependencies: []  # do not download build artifacts
   script:
-    - make lint-lua
-  tags:
-    - docker
+    - meson build_ci_luacheck
+    - ninja -C build_ci_luacheck luacheck
 
 lint:scan-build:
   <<: *test
index 54ce16b9f3bf12ea606fcc2ca87bdfc32b641221..6c2586090294e878d5c6a174cf62fe0644003bf3 100644 (file)
@@ -25,14 +25,17 @@ run_target(  # run manually to re-generate kres-gen.lua
   command: find_program('./kres-gen.sh'),
 )
 
+lua_src = [
+  config_lua,
+  files('kres.lua'),
+  files('kres-gen.lua'),
+  files('sandbox.lua'),
+  trust_anchors,
+  files('zonefile.lua'),
+]
+
 # install daemon lua sources
-install_data([
-    config_lua,
-    files('kres.lua'),
-    files('kres-gen.lua'),
-    files('sandbox.lua'),
-    trust_anchors,
-    files('zonefile.lua'),
-  ],
+install_data(
+  lua_src,
   install_dir: lib_dir,
 )
index 114c66250839a8ff054951aef8205fe80eed95c8..656e6dadb5ec9f36a3aa0136f463667ed941b4b9 100644 (file)
@@ -154,21 +154,6 @@ if get_option('bench').enabled()
 endif
 
 
-# Lint
-message('--- lint dependencies ---')
-clangtidy = find_program('clang-tidy', required: false)
-message('-------------------------')
-if clangtidy.found()
-  run_target(
-    'tidy',
-    command: [
-      clangtidy,
-      '-quiet',
-      '-p', meson.build_root(),
-    ] + c_src_lint
-  )
-endif
-
 # Tests
 subdir('tests')
 
@@ -194,6 +179,35 @@ install_data(
 )
 
 
+# Lint
+message('--- lint dependencies ---')
+clangtidy = find_program('clang-tidy', required: false)
+luacheck = find_program('luacheck', required: false)
+message('-------------------------')
+
+if clangtidy.found()
+  run_target(
+    'tidy',
+    command: [
+      clangtidy,
+      '-quiet',
+      '-p', meson.build_root(),
+    ] + c_src_lint
+  )
+endif
+
+if luacheck.found()
+  run_target(
+    'luacheck',
+    command: [
+      luacheck,
+      '--codes',
+      '--formatter', 'TAP',
+    ] + lua_mod_src + lua_src,
+  )
+endif
+
+
 # Summary message
 # NOTE: ternary operator in format() not supported
 # https://github.com/mesonbuild/meson/issues/2404