Enable yamllint
Adds yamllint to the linters with a minimal configuration, some rules are disabled to allow us to fix them in follow-ups, if we agree on them. Fixes invalid YAML file containing characters inside block. Fixes few minor linting issues. Change-Id: I936fe2c997597972d884c5fc62655d28e8aaf8c5
This commit is contained in:
		
							
								
								
									
										20
									
								
								.yamllint
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								.yamllint
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| extends: default | ||||
| ignore: | | ||||
|   .tox | ||||
|  | ||||
| rules: | ||||
|   braces: | ||||
|     max-spaces-inside: 1 | ||||
|     level: error | ||||
|   brackets: | ||||
|     max-spaces-inside: 1 | ||||
|     level: error | ||||
|   comments-indentation: disable | ||||
|   document-start: disable | ||||
|   empty-lines: | ||||
|     max: 1 | ||||
|     max-end: 2 | ||||
|   indentation: disable | ||||
|   new-line-at-end-of-file: disable | ||||
|   line-length: disable | ||||
|   truthy: false | ||||
| @@ -9,7 +9,6 @@ | ||||
|     return_content: true | ||||
|   register: go_archive_checksum | ||||
|  | ||||
|  | ||||
| - name: Download go archive | ||||
|   get_url: | ||||
|     url: "https://dl.google.com/go/go{{ go_version }}.{{ go_os }}-{{ go_arch }}.tar.gz" | ||||
|   | ||||
| @@ -48,7 +48,6 @@ | ||||
|         loop_var: zj_pdf | ||||
|       when: zj_pdf.stat.exists | ||||
|  | ||||
|  | ||||
|     - name: Return PDF artifact to Zuul | ||||
|       zuul_return: | ||||
|         data: | ||||
|   | ||||
| @@ -14,7 +14,7 @@ | ||||
|       {{ packer_variables | to_json }} | ||||
|     dest: "{{ packer_variable_tempfile.path }}" | ||||
|   when: packer_variables is defined | ||||
|   no_log: true # We don't want to log this since credentials could be passed this way | ||||
|   no_log: true  # We don't want to log this since credentials could be passed this way | ||||
|  | ||||
| - block: | ||||
|     - name: Run packer | ||||
|   | ||||
| @@ -15,6 +15,6 @@ | ||||
|   uri: | ||||
|     url: "https://hub.docker.com/v2/repositories/{{ zj_image.repository }}/tags/{{ zj_docker_tag.name }}/" | ||||
|     method: DELETE | ||||
|     status_code: [200,204] | ||||
|     status_code: [200, 204] | ||||
|     headers: | ||||
|       Authorization: "JWT {{ jwt_token.json.token }}" | ||||
|   | ||||
| @@ -23,6 +23,6 @@ | ||||
|   uri: | ||||
|     url: "https://hub.docker.com/v2/repositories/{{ zj_image.repository }}/tags/change_{{ zuul.change }}_{{ image_tag }}/" | ||||
|     method: DELETE | ||||
|     status_code: [200,204] | ||||
|     status_code: [200, 204] | ||||
|     headers: | ||||
|       Authorization: "JWT {{ jwt_token.json.token }}" | ||||
|   | ||||
| @@ -1,11 +1,12 @@ | ||||
| --- | ||||
| workdir: . | ||||
| output: | | ||||
|   tests/__init__.py:2808:8: E1120: [1;31mNo value for argument 'get_storage_profile_id' in method call[0m ([1;31mno-value-for-parameter[0m) | ||||
|   tests/__init__.py:2808:8: E1120: [1;31mNo value for argument 'select_ds_for_volume' in method call[0m ([1;31mno-value-for-parameter[0m) | ||||
|   tests/__init__.py:2812:8: E1120: [1;31mNo value for argument 'get_adapter_type' in method call[0m ([1;31mno-value-for-parameter[0m) | ||||
|   tests/__init__.py:2812:8: E1120: [1;31mNo value for argument 'get_disk_type' in method call[0m ([1;31mno-value-for-parameter[0m) | ||||
|   tests/__init__.py:2812:8: E1120: [1;31mNo value for argument 'vops' in method call[0m ([1;31mno-value-for-parameter[0m) | ||||
| output: "\ | ||||
|   tests/__init__.py:2808:8: E1120: \e[1;31mNo value for argument 'get_storage_profile_id' in method call\e[0m (\e[1;31mno-value-for-parameter\e[0m)\n\ | ||||
|   tests/__init__.py:2808:8: E1120: \e[1;31mNo value for argument 'select_ds_for_volume' in method call\e[0m (\e[1;31mno-value-for-parameter\e[0m)\n\ | ||||
|   tests/__init__.py:2812:8: E1120: \e[1;31mNo value for argument 'get_adapter_type' in method call\e[0m (\e[1;31mno-value-for-parameter\e[0m)\n\ | ||||
|   tests/__init__.py:2812:8: E1120: \e[1;31mNo value for argument 'get_disk_type' in method call\e[0m (\e[1;31mno-value-for-parameter\e[0m)\n\ | ||||
|   tests/__init__.py:2812:8: E1120: \e[1;31mNo value for argument 'vops' in method call\e[0m (\e[1;31mno-value-for-parameter\e[0m)\n\ | ||||
|   " | ||||
| comments: | ||||
|   tests/__init__.py: | ||||
|     - line: 2808 | ||||
| @@ -18,4 +19,3 @@ comments: | ||||
|       message: "E1120: No value for argument 'get_disk_type' in method call (no-value-for-parameter)" | ||||
|     - line: 2812 | ||||
|       message: "E1120: No value for argument 'vops' in method call (no-value-for-parameter)" | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| zuul_site_image_manifest_files: | ||||
|   - /etc/dib-builddate.txt | ||||
|   - /etc/image-hostname.txt | ||||
| validate_host_hostname:  "{{ inventory_hostname }}" | ||||
| validate_host_hostname: "{{ inventory_hostname }}" | ||||
|   | ||||
| @@ -84,7 +84,6 @@ | ||||
|         fi | ||||
|         exit $GLOBAL_RESULT | ||||
|  | ||||
|  | ||||
| # The following test(s) require(s) the previous playbook | ||||
| - name: Run the fetch-subunit-output role with multiple subunits | ||||
|   hosts: all | ||||
|   | ||||
| @@ -42,9 +42,9 @@ | ||||
| # has already installed from source.  We might be able to test this | ||||
| # once it's gone... | ||||
|  | ||||
| #- hosts: all | ||||
| #  roles: | ||||
| #    - role: ensure-pip | ||||
| #      vars: | ||||
| #        ensure_pip_from_upstream: True | ||||
| # - hosts: all | ||||
| #   roles: | ||||
| #     - role: ensure-pip | ||||
| #       vars: | ||||
| #         ensure_pip_from_upstream: True | ||||
|  | ||||
|   | ||||
| @@ -2,6 +2,7 @@ | ||||
| # of appearance. Changing the order has an impact on the overall integration | ||||
| # process, which may cause wedges in the gate later. | ||||
| flake8 | ||||
| yamllint>=1.23.0 | ||||
|  | ||||
| # We need to pin the ansible version directly here; per the | ||||
| # deprecation policy it should trail the version used by Zuul by 4 | ||||
|   | ||||
							
								
								
									
										1
									
								
								tox.ini
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								tox.ini
									
									
									
									
									
								
							| @@ -39,6 +39,7 @@ setenv = | ||||
| whitelist_externals = bash | ||||
| commands = | ||||
|   flake8 {posargs} | ||||
|   yamllint -s -f parsable . | ||||
|   bash -c "find playbooks -type f -regex '.*.ya?ml' ! -regex '.*vars\/.*' -print0 | \ | ||||
|     xargs -t -0 ansible-lint" | ||||
|   bash -c 'find roles -maxdepth 1 -mindepth 1 -type d | \ | ||||
|   | ||||
| @@ -230,7 +230,6 @@ | ||||
|  | ||||
|          The version of Node to use. | ||||
|  | ||||
|  | ||||
|       .. zuul:jobvar:: javascript_content_dir | ||||
|          :default: dist | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Sorin Sbarnea
					Sorin Sbarnea