diff options
author | Andrew Grimberg <agrimberg@linuxfoundation.org> | 2017-05-22 16:51:44 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-05-22 16:51:44 +0000 |
commit | 3c277c4e80d978da8e235bbdb1bdb91a0a160178 (patch) | |
tree | ea0d8ffa3d20764ef4ad55ec3c1972140c262275 | |
parent | 591164a1c3f0de2a3188463f2da680dee021f203 (diff) | |
parent | e55b622305e12f9965f2a1d73e67aa22f0e815e0 (diff) |
Merge changes from topic 'coala'
* changes:
Initial coala delint (global templates)
Initial coala delint (ecompsdkos)
Initial coala delint (ui)
Initial coala delint (scripts)
Initial coala delint (packer)
Initial coala delint (portal)
Initial coala delint (policy)
Add configuration in prep to enable coala and tox
-rw-r--r-- | .coafile | 33 | ||||
-rw-r--r-- | .editorconfig | 25 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | jjb/ecompsdkos/ecompsdkos.yaml | 4 | ||||
-rw-r--r-- | jjb/global-templates-java.yaml | 52 | ||||
-rw-r--r-- | jjb/policy/include-raw-docker-merge.sh | 2 | ||||
-rw-r--r-- | jjb/policy/include-raw-docker-release.sh | 2 | ||||
-rw-r--r-- | jjb/policy/include-raw-docker-verify.sh | 2 | ||||
-rw-r--r-- | jjb/portal/docker-build-deploy.sh | 3 | ||||
-rw-r--r-- | jjb/portal/docker-build-push.sh | 3 | ||||
-rw-r--r-- | jjb/portal/docker-build-release.sh | 3 | ||||
-rw-r--r-- | jjb/portal/portal.yaml | 4 | ||||
-rw-r--r-- | jjb/ui/ui-dmaapbc.yaml | 4 | ||||
-rw-r--r-- | packer/templates/basebuild.json | 5 | ||||
-rw-r--r-- | packer/templates/docker.json | 5 | ||||
-rw-r--r-- | packer/vars/centos.json | 1 | ||||
-rw-r--r-- | packer/vars/ubuntu-14.04.json | 1 | ||||
-rw-r--r-- | packer/vars/ubuntu-16.04.json | 1 | ||||
-rwxr-xr-x | scripts/check-unicode.sh | 16 | ||||
-rw-r--r-- | tox.ini | 21 | ||||
-rw-r--r-- | yamllint.conf | 8 |
21 files changed, 146 insertions, 54 deletions
diff --git a/.coafile b/.coafile new file mode 100644 index 000000000..3f6f8f4b6 --- /dev/null +++ b/.coafile @@ -0,0 +1,33 @@ +[GitCommit] +bears = GitCommitBear +ignore_length_regex = Signed-off-by, + Also-by, + Co-authored-by, + http://, + https:// + +[JSON] +bears = JSONFormatBear +files = **/*.json +ignore = .*/** +indent_size = 2 + +[YAML] +bears = YAMLLintBear +files = jjb/**/*.yaml +document_start = True +yamllint_config = yamllint.conf + +[ShellCheck] +bears = ShellCheckBear,SpaceConsistencyBear +files = jenkins-scripts/**/*.sh, + jjb/**/*.sh, + scripts/**/*.sh +ignore = jenkins-scripts/*-local-env.sh, + jjb/global-jjb/shell/*.sh, + jjb/include-docker-push.sh, + jjb/include-update-pom-versions.sh, + jjb/testsuite/testsuite-docker.sh, +shell = bash +indent_size = 4 +use_spaces = yeah diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..5eb4e678e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,25 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space + +[*.json] +indent_size = 2 + +[*.rst] +indent_size = 4 + +[*.markdown] +indent_size = 4 +max_line_length = 80 + +[*.sh] +indent_size = 4 +max_line_length = 80 + +[*.yaml] +indent_size = 4 + diff --git a/.gitignore b/.gitignore index f4cd20b9b..e824ce3fc 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,8 @@ target/ # Eclipse .project /.pydevproject + +# Python +.tox/ +__pycache__/ +*.pyc diff --git a/jjb/ecompsdkos/ecompsdkos.yaml b/jjb/ecompsdkos/ecompsdkos.yaml index 89b88d5d6..035d3839e 100644 --- a/jjb/ecompsdkos/ecompsdkos.yaml +++ b/jjb/ecompsdkos/ecompsdkos.yaml @@ -12,8 +12,8 @@ - '{project-name}-{stream}-{subproject}-merge-java' - '{project-name}-{stream}-{subproject}-release-java-daily' - '{project-name}-{stream}-stage-site-java': - site-pom: 'ecomp-sdk/pom.xml' - trigger-job: '{project-name}-{stream}-{subproject}-release-java-daily' + site-pom: 'ecomp-sdk/pom.xml' + trigger-job: '{project-name}-{stream}-{subproject}-release-java-daily' project: 'ecompsdkos' stream: diff --git a/jjb/global-templates-java.yaml b/jjb/global-templates-java.yaml index 66013dee6..52e0c3a57 100644 --- a/jjb/global-templates-java.yaml +++ b/jjb/global-templates-java.yaml @@ -49,7 +49,8 @@ settings-file: '{mvn-settings}' - maven-target: maven-version: '{maven-version}' - goals: 'clean install -DskipTests=true -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + goals: 'clean install -DskipTests=true -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' settings: '{mvn-settings}' settings-type: cfp global-settings: 'global-settings' @@ -111,7 +112,8 @@ settings-file: '{mvn-settings}' - maven-target: maven-version: '{maven-version}' - goals: 'clean install -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + goals: 'clean install -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' settings: '{mvn-settings}' settings-type: cfp global-settings: 'global-settings' @@ -171,7 +173,8 @@ settings-file: '{mvn-settings}' - maven-target: maven-version: '{maven-version}' - goals: 'clean install -P {mvn-profile} -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + goals: 'clean install -P {mvn-profile} -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' settings: '{mvn-settings}' settings-type: cfp global-settings: 'global-settings' @@ -235,7 +238,8 @@ - maven-target: maven-version: '{maven-version}' pom: '{pom}' - goals: 'clean install -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + goals: 'clean install -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' settings: '{mvn-settings}' settings-type: cfp global-settings: 'global-settings' @@ -295,7 +299,8 @@ - maven-target: maven-version: '{maven-version}' - goals: 'clean deploy sonar:sonar -Dsonar.host.url=${{SONAR}} -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + goals: 'clean deploy sonar:sonar -Dsonar.host.url=${{SONAR}} -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' properties: - '{maven-deploy-properties}' settings: '{mvn-settings}' @@ -369,7 +374,8 @@ - maven-target: maven-version: '{maven-version}' - goals: 'clean deploy sonar:sonar -Dsonar.host.url=${{SONAR}} -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + goals: 'clean deploy sonar:sonar -Dsonar.host.url=${{SONAR}} -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' properties: - '{maven-deploy-properties}' settings: '{mvn-settings}' @@ -435,7 +441,8 @@ - maven-target: maven-version: '{maven-version}' pom: '{pom}' - goals: 'clean deploy sonar:sonar -Dsonar.host.url=${{SONAR}} -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + goals: 'clean deploy sonar:sonar -Dsonar.host.url=${{SONAR}} -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' properties: - '{maven-deploy-properties}' settings: '{mvn-settings}' @@ -495,9 +502,8 @@ settings-file: '{mvn-settings}' - maven-target: maven-version: '{maven-version}' - # yamllint disable rule:line-length - goals: 'clean deploy -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' - # yamllint enable + goals: 'clean deploy -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' settings: '{mvn-settings}' settings-type: cfp global-settings: 'global-settings' @@ -558,9 +564,8 @@ - maven-target: maven-version: '{maven-version}' - # yamllint disable rule:line-length - goals: 'clean deploy -P {mvn-profile} -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' - # yamllint enable + goals: 'clean deploy -P {mvn-profile} -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' settings: '{mvn-settings}' settings-type: cfp global-settings: 'global-settings' @@ -625,9 +630,8 @@ settings-file: '{mvn-settings}' - maven-target: maven-version: '{maven-version}' - # yamllint disable rule:line-length - goals: 'clean deploy -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' - # yamllint enable + goals: 'clean deploy -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' settings: '{mvn-settings}' settings-type: cfp global-settings: 'global-settings' @@ -690,9 +694,8 @@ - maven-target: maven-version: '{maven-version}' pom: '{pom}' - # yamllint disable rule:line-length - goals: 'clean deploy -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' - # yamllint enable + goals: 'clean deploy -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' settings: '{mvn-settings}' settings-type: cfp global-settings: 'global-settings' @@ -996,7 +999,8 @@ - maven-target: maven-version: '{maven-version}' pom: 'pom.xml' - goals: 'clean install -DskipTests -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + goals: 'clean install -DskipTests -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' settings: '{mvn-settings}' settings-type: cfp global-settings: 'global-settings' @@ -1084,7 +1088,9 @@ - maven-target: maven-version: '{maven-version}' - goals: 'clean deploy sonar:sonar site:site site:stage-deploy -Dsonar.host.url=${{SONAR}} -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + goals: 'clean deploy sonar:sonar site:site site:stage-deploy + -Dsonar.host.url=${{SONAR}} -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' properties: - '{maven-deploy-properties}' settings: '{mvn-settings}' @@ -1165,7 +1171,9 @@ - maven-target: maven-version: '{maven-version}' pom: '{pom}' - goals: 'clean deploy sonar:sonar site:site site:stage-deploy -Dsonar.host.url=${{SONAR}} -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + goals: 'clean deploy sonar:sonar site:site site:stage-deploy + -Dsonar.host.url=${{SONAR}} -B + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' properties: - '{maven-deploy-properties}' settings: '{mvn-settings}' diff --git a/jjb/policy/include-raw-docker-merge.sh b/jjb/policy/include-raw-docker-merge.sh index 998a93d26..abb38abe1 100644 --- a/jjb/policy/include-raw-docker-merge.sh +++ b/jjb/policy/include-raw-docker-merge.sh @@ -7,4 +7,4 @@ echo $CURRENTDIR chmod 755 *.* -./docker_merge.sh
\ No newline at end of file +./docker_merge.sh diff --git a/jjb/policy/include-raw-docker-release.sh b/jjb/policy/include-raw-docker-release.sh index 00aa7f74c..68a24b1fd 100644 --- a/jjb/policy/include-raw-docker-release.sh +++ b/jjb/policy/include-raw-docker-release.sh @@ -7,4 +7,4 @@ echo $CURRENTDIR chmod 755 *.* -./docker_build.sh
\ No newline at end of file +./docker_build.sh diff --git a/jjb/policy/include-raw-docker-verify.sh b/jjb/policy/include-raw-docker-verify.sh index c89b26778..2a7dd7b23 100644 --- a/jjb/policy/include-raw-docker-verify.sh +++ b/jjb/policy/include-raw-docker-verify.sh @@ -7,4 +7,4 @@ echo $CURRENTDIR chmod 755 *.* -./docker_verify.sh
\ No newline at end of file +./docker_verify.sh diff --git a/jjb/portal/docker-build-deploy.sh b/jjb/portal/docker-build-deploy.sh index f7d1b823f..dd114af76 100644 --- a/jjb/portal/docker-build-deploy.sh +++ b/jjb/portal/docker-build-deploy.sh @@ -1,8 +1,7 @@ - CURRENTDIR="$(pwd)" echo $CURRENTDIR ls -ltr cd deliveries ls -ltr chmod 755 *.* -./run.sh
\ No newline at end of file +./run.sh diff --git a/jjb/portal/docker-build-push.sh b/jjb/portal/docker-build-push.sh index ca2c8760b..c3851dd48 100644 --- a/jjb/portal/docker-build-push.sh +++ b/jjb/portal/docker-build-push.sh @@ -1,8 +1,7 @@ - CURRENTDIR="$(pwd)" echo $CURRENTDIR ls -ltr cd deliveries ls -ltr chmod 755 *.* -./os_docker_push.sh
\ No newline at end of file +./os_docker_push.sh diff --git a/jjb/portal/docker-build-release.sh b/jjb/portal/docker-build-release.sh index 4f8c14eb2..89a5fc131 100644 --- a/jjb/portal/docker-build-release.sh +++ b/jjb/portal/docker-build-release.sh @@ -1,8 +1,7 @@ - CURRENTDIR="$(pwd)" echo $CURRENTDIR ls -ltr cd deliveries ls -ltr chmod 755 *.* -./os_docker_release.sh
\ No newline at end of file +./os_docker_release.sh diff --git a/jjb/portal/portal.yaml b/jjb/portal/portal.yaml index 2cfe69f90..399c4ea17 100644 --- a/jjb/portal/portal.yaml +++ b/jjb/portal/portal.yaml @@ -5,8 +5,8 @@ jobs: - '{project-name}-{stream}-release-version-java-daily' - '{project-name}-{stream}-stage-site-java': - site-pom: 'pom.xml' - trigger-job: '{project-name}-{stream}-release-version-java-daily' + site-pom: 'pom.xml' + trigger-job: '{project-name}-{stream}-release-version-java-daily' project: 'portal' stream: diff --git a/jjb/ui/ui-dmaapbc.yaml b/jjb/ui/ui-dmaapbc.yaml index 78a493300..a57a5af22 100644 --- a/jjb/ui/ui-dmaapbc.yaml +++ b/jjb/ui/ui-dmaapbc.yaml @@ -8,8 +8,8 @@ - '{project-name}-{stream}-merge-java' - '{project-name}-{stream}-release-version-java-daily' - '{project-name}-{stream}-stage-site-java': - site-pom: 'pom.xml' - trigger-job: '{project-name}-{stream}-release-version-java-daily' + site-pom: 'pom.xml' + trigger-job: '{project-name}-{stream}-release-version-java-daily' project: 'ui/dmaapbc' stream: diff --git a/packer/templates/basebuild.json b/packer/templates/basebuild.json index 426f290af..ff84a72d6 100644 --- a/packer/templates/basebuild.json +++ b/packer/templates/basebuild.json @@ -4,7 +4,6 @@ "stack_user": null, "stack_pass": null, "stack_network": null, - "base_image": null, "cloud_user": null, "distro": null, @@ -32,7 +31,9 @@ "provisioners": [ { "type": "shell", - "inline": ["mkdir -p /tmp/packer"] + "inline": [ + "mkdir -p /tmp/packer" + ] }, { "type": "file", diff --git a/packer/templates/docker.json b/packer/templates/docker.json index 5418c4b02..1c8d3ec56 100644 --- a/packer/templates/docker.json +++ b/packer/templates/docker.json @@ -4,7 +4,6 @@ "stack_user": null, "stack_pass": null, "stack_network": null, - "base_image": null, "cloud_user": null, "distro": null, @@ -32,7 +31,9 @@ "provisioners": [ { "type": "shell", - "inline": ["mkdir -p /tmp/packer"] + "inline": [ + "mkdir -p /tmp/packer" + ] }, { "type": "file", diff --git a/packer/vars/centos.json b/packer/vars/centos.json index 7516bcc87..c5b8c79f2 100644 --- a/packer/vars/centos.json +++ b/packer/vars/centos.json @@ -1,7 +1,6 @@ { "base_image": "CentOS 7.1611 (2017-01-30) - LF upload", "cloud_user": "centos", - "distro": "CentOS 7", "cloud_user_data": "provision/rh-user_data.sh" } diff --git a/packer/vars/ubuntu-14.04.json b/packer/vars/ubuntu-14.04.json index 938194b52..dd81e2594 100644 --- a/packer/vars/ubuntu-14.04.json +++ b/packer/vars/ubuntu-14.04.json @@ -1,7 +1,6 @@ { "base_image": "Ubuntu 14.04 (2017-02-01) - LF upload", "cloud_user": "ubuntu", - "distro": "Ubuntu 14.04", "cloud_user_data": "provision/null_data.sh" } diff --git a/packer/vars/ubuntu-16.04.json b/packer/vars/ubuntu-16.04.json index c45de861e..12f9430ed 100644 --- a/packer/vars/ubuntu-16.04.json +++ b/packer/vars/ubuntu-16.04.json @@ -1,7 +1,6 @@ { "base_image": "Ubuntu 16.04 (2017-02-01) - LF upload", "cloud_user": "ubuntu", - "distro": "Ubuntu 16.04", "cloud_user_data": "provision/null_data.sh" } diff --git a/scripts/check-unicode.sh b/scripts/check-unicode.sh index db45f6ac6..931c99fac 100755 --- a/scripts/check-unicode.sh +++ b/scripts/check-unicode.sh @@ -13,17 +13,13 @@ # Thanh Ha (The Linux Foundation) - Initial implementation ############################################################################## -directory="." -if [ ! -z "$1" ]; then - directory="$1" -fi +directory=${1:-"."} echo "Scanning $directory" -for x in $(find $directory -type f); do - if LC_ALL=C grep -q '[^[:print:][:space:]]' "$x"; then - echo "file "$x" contains non-ascii characters" - exit 1 - fi -done +if LC_ALL=C grep -r '[^[:print:][:space:]]' "$directory"; then + echo "Found files containing non-ascii characters." + exit 1 +fi echo "All files are ASCII only" + diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..dbeedd8bd --- /dev/null +++ b/tox.ini @@ -0,0 +1,21 @@ +[tox] +minversion = 1.6 +envlist = coala,docs,pep8 +skipsdist = true + +[testenv:coala] +basepython = python3 +deps = + coala + coala-bears +commands = + python3 -m nltk.downloader punkt maxent_treebank_pos_tagger averaged_perceptron_tagger + coala --non-interactive + +# [testenv:docs] +# deps = sphinx +# commands = sphinx-build -b html -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html + +[testenv:pep8] +deps = flake8 +commands = flake8 scripts/ diff --git a/yamllint.conf b/yamllint.conf new file mode 100644 index 000000000..32d76ab6e --- /dev/null +++ b/yamllint.conf @@ -0,0 +1,8 @@ +extends: default + +rules: + empty-lines: + max-end: 1 + line-length: + max: 120 + |