mirror of
				https://github.com/TheLocehiliosan/yadm
				synced 2025-06-13 13:03:58 +00:00 
			
		
		
		
	Validate yaml files with yamllint
This commit is contained in:
		
							parent
							
								
									ca2f93146d
								
							
						
					
					
						commit
						826f9bc09e
					
				| @ -27,9 +27,10 @@ RUN \ | ||||
|   ; | ||||
| RUN pip3 install \ | ||||
|       envtpl \ | ||||
|       pytest==3.6.4 \ | ||||
|       pylint==1.9.2 \ | ||||
|       flake8==3.5.0 \ | ||||
|       pylint==1.9.2 \ | ||||
|       pytest==3.6.4 \ | ||||
|       yamllint==1.15.0 \ | ||||
|     ; | ||||
| 
 | ||||
| # Force GNUPG version 1 at path /usr/bin/gpg | ||||
|  | ||||
| @ -28,6 +28,12 @@ def flake8_version(): | ||||
|     return '3.5.0' | ||||
| 
 | ||||
| 
 | ||||
| @pytest.fixture(scope='session') | ||||
| def yamllint_version(): | ||||
|     """Version of yamllint supported""" | ||||
|     return '1.15.0' | ||||
| 
 | ||||
| 
 | ||||
| @pytest.fixture(scope='session') | ||||
| def tst_user(): | ||||
|     """Test session's user id""" | ||||
|  | ||||
| @ -39,3 +39,14 @@ def test_flake8(runner, flake8_version): | ||||
|         pytest.skip('Unsupported flake8 version') | ||||
|     run = runner(command=['flake8', 'test']) | ||||
|     assert run.success | ||||
| 
 | ||||
| 
 | ||||
| def test_yamllint(runner, yamllint_version): | ||||
|     """Passes yamllint""" | ||||
|     run = runner(command=['yamllint', '--version'], report=False) | ||||
|     if not run.out.strip().endswith(yamllint_version): | ||||
|         pytest.skip('Unsupported yamllint version') | ||||
|     run = runner( | ||||
|         command=['yamllint', '-s', '$(find . -name \\*.yml)'], | ||||
|         shell=True) | ||||
|     assert run.success | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user