mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	[core] Fix running pylint via pre-commit from GUI apps (#6754)
This commit is contained in:
		| @@ -44,6 +44,6 @@ repos: | |||||||
|     hooks: |     hooks: | ||||||
|       - id: pylint |       - id: pylint | ||||||
|         name: pylint |         name: pylint | ||||||
|         entry: pylint |         entry: script/run-in-env.sh pylint | ||||||
|         language: system |         language: script | ||||||
|         types: [python] |         types: [python] | ||||||
|   | |||||||
							
								
								
									
										13
									
								
								script/run-in-env.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										13
									
								
								script/run-in-env.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,13 @@ | |||||||
|  | #!/usr/bin/env sh | ||||||
|  | set -eu | ||||||
|  |  | ||||||
|  | my_path=$(git rev-parse --show-toplevel) | ||||||
|  |  | ||||||
|  | for venv in venv .venv .; do | ||||||
|  |   if [ -f "${my_path}/${venv}/bin/activate" ]; then | ||||||
|  |     . "${my_path}/${venv}/bin/activate" | ||||||
|  |     break | ||||||
|  |   fi | ||||||
|  | done | ||||||
|  |  | ||||||
|  | exec "$@" | ||||||
		Reference in New Issue
	
	Block a user