Skip to content

Commit

Permalink
[AIRFLOW-5316] Skip running check-apache-license without --all-files (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
potiuk authored Aug 27, 2019
1 parent c8ea096 commit 308c07b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ repos:
name: Check if licences are OK for Apache
entry: ./scripts/ci/ci_check_license.sh
language: system
always_run: true
pass_filenames: false
files: ^\.pre-commit-config\.yaml$
pass_filenames: true
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.6
hooks:
Expand Down
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ In airflow we have the following checks:

```text
check-hooks-apply Check hooks apply to the repository
check-apache-license Checks compatibility with Apache License requirements
check-merge-conflict Checks if merge conflict is being committed
check-executables-have-shebangs Check that executables have shebang
check-xml Check XML files with xmllint
Expand All @@ -712,6 +713,13 @@ pylint Run pylint
shellcheck Check shell files with shellcheck
yamllint Check yaml files with yamllint
```

The check-apache-licence check is normally skipped for commits unless `.pre-commit-config.yaml` file
is changed. This check always run for the full set of files and if you want to run it locally you need to
specify `--all-files` flag of pre-commit. For example:

`pre-commit run check-apache-licenses --all-files`

## Using pre-commit hooks

After installing pre-commit hooks are run automatically when you commit the code, but you can
Expand Down

0 comments on commit 308c07b

Please sign in to comment.