Fix yamllint recommendations

This commit is contained in:
Jason Hollis 2020-12-06 12:28:19 -05:00
parent 9cbfcde81a
commit 346d5c0de7
35 changed files with 312 additions and 238 deletions

2
.github/FUNDING.yml vendored
View file

@ -1,2 +1,4 @@
---
github: asottile github: asottile
open_collective: pre-commit open_collective: pre-commit

View file

@ -1,6 +1,8 @@
- id: validate_manifest ---
name: Validate Pre-Commit Manifest
description: This validator validates a pre-commit hooks manifest file - id: validate_manifest
entry: pre-commit-validate-manifest name: Validate Pre-Commit Manifest
language: python description: This validator validates a pre-commit hooks manifest file
files: ^(\.pre-commit-hooks\.yaml|hooks\.yaml)$ entry: pre-commit-validate-manifest
language: python
files: ^(\.pre-commit-hooks\.yaml|hooks\.yaml)$

View file

@ -1,3 +1,5 @@
---
trigger: trigger:
branches: branches:
include: [master, test-me-*] include: [master, test-me-*]
@ -13,46 +15,46 @@ resources:
ref: refs/tags/v2.0.0 ref: refs/tags/v2.0.0
jobs: jobs:
- template: job--python-tox.yml@asottile - template: job--python-tox.yml@asottile
parameters: parameters:
toxenvs: [py37] toxenvs: [py37]
os: windows os: windows
pre_test: pre_test:
- task: UseRubyVersion@0 - task: UseRubyVersion@0
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH displayName: Add conda to PATH
- powershell: | - powershell: |
Write-Host "##vso[task.prependpath]C:\Strawberry\perl\bin" Write-Host "##vso[task.prependpath]C:\Strawberry\perl\bin"
Write-Host "##vso[task.prependpath]C:\Strawberry\perl\site\bin" Write-Host "##vso[task.prependpath]C:\Strawberry\perl\site\bin"
Write-Host "##vso[task.prependpath]C:\Strawberry\c\bin" Write-Host "##vso[task.prependpath]C:\Strawberry\c\bin"
displayName: Add strawberry perl to PATH displayName: Add strawberry perl to PATH
- template: job--python-tox.yml@asottile - template: job--python-tox.yml@asottile
parameters: parameters:
toxenvs: [py37] toxenvs: [py37]
os: linux os: linux
name_postfix: _latest_git name_postfix: _latest_git
pre_test: pre_test:
- task: UseRubyVersion@0 - task: UseRubyVersion@0
- template: step--git-install.yml - template: step--git-install.yml
- bash: | - bash: |
testing/get-coursier.sh testing/get-coursier.sh
echo '##vso[task.prependpath]/tmp/coursier' echo '##vso[task.prependpath]/tmp/coursier'
displayName: install coursier displayName: install coursier
- bash: | - bash: |
testing/get-swift.sh testing/get-swift.sh
echo '##vso[task.prependpath]/tmp/swift/usr/bin' echo '##vso[task.prependpath]/tmp/swift/usr/bin'
displayName: install swift displayName: install swift
- template: job--python-tox.yml@asottile - template: job--python-tox.yml@asottile
parameters: parameters:
toxenvs: [pypy3, py36, py37, py38, py39] toxenvs: [pypy3, py36, py37, py38, py39]
os: linux os: linux
pre_test: pre_test:
- task: UseRubyVersion@0 - task: UseRubyVersion@0
- bash: | - bash: |
testing/get-coursier.sh testing/get-coursier.sh
echo '##vso[task.prependpath]/tmp/coursier' echo '##vso[task.prependpath]/tmp/coursier'
displayName: install coursier displayName: install coursier
- bash: | - bash: |
testing/get-swift.sh testing/get-swift.sh
echo '##vso[task.prependpath]/tmp/swift/usr/bin' echo '##vso[task.prependpath]/tmp/swift/usr/bin'
displayName: install swift displayName: install swift

View file

@ -1,3 +1,5 @@
---
channels: channels:
- conda-forge - conda-forge
- defaults - defaults

View file

@ -1,5 +1,7 @@
- id: hook ---
name: hook
entry: ./hook.sh - id: hook
language: script name: hook
files: \.py$ entry: ./hook.sh
language: script
files: \.py$

View file

@ -1,6 +1,8 @@
- id: arg-per-line ---
name: Args per line hook
entry: bin/hook.sh - id: arg-per-line
language: script name: Args per line hook
files: '' entry: bin/hook.sh
args: [hello, world] language: script
files: ''
args: [hello, world]

View file

@ -1,10 +1,13 @@
- id: sys-exec ---
name: sys-exec
entry: python -c 'import os; import sys; print(sys.executable.split(os.path.sep)[-2]) if os.name == "nt" else print(sys.executable.split(os.path.sep)[-3])' - id: sys-exec
language: conda name: sys-exec
files: \.py$ entry: python -c 'import os; import sys; print(sys.executable.split(os.path.sep)[-2]) if os.name == "nt" else print(sys.executable.split(os.path.sep)[-3])'
- id: additional-deps language: conda
name: additional-deps files: \.py$
entry: python
language: conda - id: additional-deps
files: \.py$ name: additional-deps
entry: python
language: conda
files: \.py$

View file

@ -1,3 +1,5 @@
---
channels: channels:
- conda-forge - conda-forge
- defaults - defaults

View file

@ -1,5 +1,7 @@
- id: echo-java ---
name: echo-java
description: echo from java - id: echo-java
entry: echo-java name: echo-java
language: coursier description: echo from java
entry: echo-java
language: coursier

View file

@ -1,17 +1,19 @@
- id: docker-hook ---
name: Docker test hook
entry: echo
language: docker
files: \.txt$
- id: docker-hook-arg - id: docker-hook
name: Docker test hook name: Docker test hook
entry: echo -n entry: echo
language: docker language: docker
files: \.txt$ files: \.txt$
- id: docker-hook-failing - id: docker-hook-arg
name: Docker test hook with nonzero exit code name: Docker test hook
entry: bork entry: echo -n
language: docker language: docker
files: \.txt$ files: \.txt$
- id: docker-hook-failing
name: Docker test hook with nonzero exit code
entry: bork
language: docker
files: \.txt$

View file

@ -1,8 +1,11 @@
- id: echo-entrypoint ---
name: echo (via --entrypoint)
language: docker_image - id: echo-entrypoint
entry: --entrypoint echo cogniteev/echo name: echo (via --entrypoint)
- id: echo-cmd language: docker_image
name: echo (via cmd) entry: --entrypoint echo cogniteev/echo
language: docker_image
entry: cogniteev/echo echo - id: echo-cmd
name: echo (via cmd)
lguage: docker_image
entry: cogniteev/echo echo

View file

@ -1,5 +1,7 @@
- id: dotnet example hook ---
name: dotnet example hook
entry: testeroni - id: dotnet example hook
language: dotnet name: dotnet example hook
files: '' entry: testeroni
language: dotnet
files: ''

View file

@ -1,5 +1,7 @@
- id: dotnet example hook ---
name: dotnet example hook
entry: testeroni - id: dotnet example hook
language: dotnet name: dotnet example hook
files: '' entry: testeroni
language: dotnet
files: ''

View file

@ -1,6 +1,8 @@
- id: python-files ---
name: Python files
entry: bin/hook.sh - id: python-files
language: script name: Python files
types: [python] entry: bin/hook.sh
exclude_types: [python3] language: script
types: [python]
exclude_types: [python3]

View file

@ -1,5 +1,7 @@
- id: failing_hook ---
name: Failing hook
entry: bin/hook.sh - id: failing_hook
language: script name: Failing hook
files: . entry: bin/hook.sh
language: script
files: .

View file

@ -1,5 +1,7 @@
- id: golang-hook ---
name: golang example hook
entry: golang-hello-world - id: golang-hook
language: golang name: golang example hook
files: '' entry: golang-hello-world
language: golang
files: ''

View file

@ -1,6 +1,8 @@
- id: logfile test hook ---
name: Logfile test hook
entry: bin/hook.sh - id: logfile test hook
language: script name: Logfile test hook
files: . entry: bin/hook.sh
log_file: test.log language: script
files: .
log_file: test.log

View file

@ -1,15 +1,19 @@
- id: bash_hook ---
name: Bash hook
entry: bin/hook.sh - id: bash_hook
language: script name: Bash hook
files: 'foo.py' entry: bin/hook.sh
- id: bash_hook2 language: script
name: Bash hook files: 'foo.py'
entry: bin/hook2.sh
language: script - id: bash_hook2
files: '' name: Bash hook
- id: bash_hook3 entry: bin/hook2.sh
name: Bash hook language: script
entry: bin/hook3.sh files: ''
language: script
files: 'bar.py' - id: bash_hook3
name: Bash hook
entry: bin/hook3.sh
language: script
files: 'bar.py'

View file

@ -1,5 +1,7 @@
- id: foo ---
name: Foo
entry: foo - id: foo
language: node name: Foo
files: \.js$ entry: foo
language: node
files: \.js$

View file

@ -1,6 +1,8 @@
- id: versioned-node-hook ---
name: Versioned node hook
entry: versioned-node-hook - id: versioned-node-hook
language: node name: Versioned node hook
language_version: 9.3.0 entry: versioned-node-hook
files: \.js$ language: node
language_version: 9.3.0
files: \.js$

View file

@ -1,5 +1,7 @@
- id: not-found-exe ---
name: Not found exe
entry: i-dont-exist-lol - id: not-found-exe
language: system name: Not found exe
files: '' entry: i-dont-exist-lol
language: system
files: ''

View file

@ -1,5 +1,7 @@
- id: perl-hook ---
name: perl example hook
entry: pre-commit-perl-hello - id: perl-hook
language: perl name: perl example hook
files: '' entry: pre-commit-perl-hello
language: perl
files: ''

View file

@ -1,5 +1,7 @@
- id: prints_cwd ---
name: Prints Cwd
entry: pwd - id: prints_cwd
language: system name: Prints Cwd
files: \.sh$ entry: pwd
language: system
files: \.sh$

View file

@ -1,6 +1,8 @@
- id: python3-hook ---
name: Python 3 Hook
entry: python3-hook - id: python3-hook
language: python name: Python 3 Hook
language_version: python3 entry: python3-hook
files: \.py$ language: python
language_version: python3
files: \.py$

View file

@ -1,5 +1,7 @@
- id: foo ---
name: Foo
entry: foo - id: foo
language: python name: Foo
files: \.py$ entry: foo
language: python
files: \.py$

View file

@ -1,5 +1,7 @@
- id: foo ---
name: Foo
entry: foo - id: foo
language: python_venv name: Foo
files: \.py$ entry: foo
language: python_venv
files: \.py$

View file

@ -1,5 +1,7 @@
- id: ruby_hook ---
name: Ruby Hook
entry: ruby_hook - id: ruby_hook
language: ruby name: Ruby Hook
files: \.rb$ entry: ruby_hook
language: ruby
files: \.rb$

View file

@ -1,6 +1,8 @@
- id: ruby_hook ---
name: Ruby Hook
entry: ruby_hook - id: ruby_hook
language: ruby name: Ruby Hook
language_version: 2.5.1 entry: ruby_hook
files: \.rb$ language: ruby
language_version: 2.5.1
files: \.rb$

View file

@ -1,5 +1,7 @@
- id: rust-hook ---
name: rust example hook
entry: rust-hello-world - id: rust-hook
language: rust name: rust example hook
files: '' entry: rust-hello-world
language: rust
files: ''

View file

@ -1,5 +1,7 @@
- id: bash_hook ---
name: Bash hook
entry: bin/hook.sh - id: bash_hook
language: script name: Bash hook
files: '' entry: bin/hook.sh
language: script
files: ''

View file

@ -1,8 +1,10 @@
- id: stdout-stderr ---
name: stdout-stderr
language: script - id: stdout-stderr
entry: ./stdout-stderr-entry name: stdout-stderr
- id: tty-check language: script
name: tty-check entry: ./stdout-stderr-entry
language: script - id: tty-check
entry: ./tty-check-entry name: tty-check
language: script
entry: ./tty-check-entry

View file

@ -1,6 +1,8 @@
- id: swift-hooks-repo ---
name: Swift hooks repo example
description: Runs the hello world app generated by swift package init --type executable (binary called swift_hooks_repo here) - id: swift-hooks-repo
entry: swift_hooks_repo name: Swift hooks repo example
language: swift description: Runs the hello world app generated by swift package init --type executable (binary called swift_hooks_repo here)
files: \.(swift)$ entry: swift_hooks_repo
language: swift
files: \.(swift)$

View file

@ -1,5 +1,7 @@
- id: system-hook-with-spaces ---
name: System hook with spaces
entry: bash -c 'echo "Hello World"' - id: system-hook-with-spaces
language: system name: System hook with spaces
files: \.sh$ entry: bash -c 'echo "Hello World"'
language: system
files: \.sh$

View file

@ -1,6 +1,8 @@
- id: python-cython-files ---
name: Python and Cython files
entry: bin/hook.sh - id: python-cython-files
language: script name: Python and Cython files
types: [file] entry: bin/hook.sh
types_or: [python, cython] language: script
types: [file]
types_or: [python, cython]

View file

@ -1,5 +1,7 @@
- id: python-files ---
name: Python files
entry: bin/hook.sh - id: python-files
language: script name: Python files
types: [python] entry: bin/hook.sh
language: script
types: [python]