ci: static code analysis enabled
Signed-off-by: Thomas Klaehn <thomas.klaehn@u-blox.com>
This commit is contained in:
		@@ -1,22 +1,22 @@
 | 
			
		||||
#variables:
 | 
			
		||||
variables:
 | 
			
		||||
#  SW_KERNEL: "0"
 | 
			
		||||
#  SW_MAJOR: "1"
 | 
			
		||||
#  SW_MINOR: "10"
 | 
			
		||||
 | 
			
		||||
#before_script:
 | 
			
		||||
#  - "echo $CI_BUILD_ID"
 | 
			
		||||
#  - "echo $CI_BUILD_REF_NAME"
 | 
			
		||||
before_script:
 | 
			
		||||
  - "echo $CI_BUILD_ID"
 | 
			
		||||
  - "echo $CI_BUILD_REF_NAME"
 | 
			
		||||
 | 
			
		||||
#stages:
 | 
			
		||||
#  - static_analysis
 | 
			
		||||
stages:
 | 
			
		||||
  - static_analysis
 | 
			
		||||
#  - test
 | 
			
		||||
 | 
			
		||||
#static_analysis_tests:
 | 
			
		||||
#  stage: static_analysis
 | 
			
		||||
#  script:
 | 
			
		||||
# 	   - "python pylint_wrapper.py -s src -s tests"
 | 
			
		||||
static_analysis_tests:
 | 
			
		||||
  stage: static_analysis
 | 
			
		||||
  script:
 | 
			
		||||
    - "python pylint_wrapper.py -s mqtt_logger"
 | 
			
		||||
 | 
			
		||||
#unit_tests:
 | 
			
		||||
#  stage: test
 | 
			
		||||
#  script:
 | 
			
		||||
#    - "nosetests tests/unittest/"
 | 
			
		||||
#    - "nosetests tests/unittests/"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										27
									
								
								pylint_wrapper.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								pylint_wrapper.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
'''
 | 
			
		||||
Created on Feb 11, 2017
 | 
			
		||||
 | 
			
		||||
@author: tkl
 | 
			
		||||
'''
 | 
			
		||||
import os
 | 
			
		||||
import sys
 | 
			
		||||
import getopt
 | 
			
		||||
 | 
			
		||||
def main(argv):
 | 
			
		||||
    options, _ = getopt.getopt(argv, "s:", ["source="])
 | 
			
		||||
    source_list = []
 | 
			
		||||
    for opt, args in options:
 | 
			
		||||
        if opt in ("-s", "--source"):
 | 
			
		||||
            source_list.append(args)
 | 
			
		||||
 | 
			
		||||
    source_str = ""
 | 
			
		||||
    for source in source_list:
 | 
			
		||||
        source_str += source + " "
 | 
			
		||||
 | 
			
		||||
    os.system("pylint " + source_str)
 | 
			
		||||
#    pylint for sonar cube
 | 
			
		||||
#    os.system("pylint " + source_str + " -r n --msg-template=\"{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}\" > sonar.report")
 | 
			
		||||
    return 0
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    sys.exit(main(sys.argv[1:]))
 | 
			
		||||
		Reference in New Issue
	
	Block a user