You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by mr...@apache.org on 2019/09/18 17:29:47 UTC

[openwhisk-utilities] branch master updated: Improve pre-commit sample for openwhisk (#72)

This is an automated email from the ASF dual-hosted git repository.

mrutkowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-utilities.git


The following commit(s) were added to refs/heads/master by this push:
     new 3988a24  Improve pre-commit sample for openwhisk (#72)
3988a24 is described below

commit 3988a24e1252d913e027bb441ad1609b0dccb98b
Author: Sven Lange-Last <sv...@de.ibm.com>
AuthorDate: Wed Sep 18 19:29:42 2019 +0200

    Improve pre-commit sample for openwhisk (#72)
    
    The current code sample does not scan the full openwhisk directory but only starting from the current directory. In addition, no configuration file is specified.
    
    With this change, the pre-commit hook scans the full openwhisk directory and uses the scan configuration that is also used in the openwhisk Travis configuration.
---
 README.md | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index ad37e5a..8966979 100644
--- a/README.md
+++ b/README.md
@@ -64,9 +64,12 @@ It is worth adding a Git [pre-commit hook](https://git-scm.com/book/en/v2/Custom
 $ cat /path/to/openwhisk/.git/hooks/pre-commit
 #!/usr/bin/env bash
 
+# -- Code scanning --
+# See https://github.com/apache/openwhisk-utilities
 # determine openwhisk base directory
 root="$(git rev-parse --show-toplevel)"
-python /path/to/openwhisk-utilities/scancode/scanCode.py . --config $root/tools/ --gitignore $root/.gitignore
+scancode_path="/path/to/openwhisk-utilities/scancode"
+python $scancode_path/scanCode.py --config $scancode_path/ASF-Release.cfg --gitignore $root/.gitignore $root
 ```
 
 _Note_: A hook a locally installed, so if you check out the repository again, you will need to reinstall it.