diff --git a/README.md b/README.md index 4dc54f0..befa5fd 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # kubernetes contribution tools This repo holds tools for kubernetes contributors, it is intended to be used in -kubernetes (related) repos ranging from [k/k repo](github.com/kubernetes/kubernetes) -to [kubernetes-sigs repos](github.com/kubernetes-sigs). +kubernetes (related) repos ranging from [k/k repo](https://github.com/kubernetes/kubernetes) +to [kubernetes-sigs repos](https://github.com/kubernetes-sigs). ## Using, Installation @@ -21,11 +21,11 @@ need to be named `verify-boilerplate.sh`/`ensure-boilerplate.sh`. #### Use -- `verify-boilerplate.sh` +- `verify-boilerplate.sh` Checks all applicable files in the repo for their license/copyright header, and warns if the header is missing for a file. -- `ensure-boilerplate.sh` +- `ensure-boilerplate.sh` Will add a license/copyright header for files which don't have one yet. It will not update existing headers. @@ -50,9 +50,9 @@ You can put a config file into the root of your repo named `boilerplate.json`. T } ``` Currently supported settings are -- `dirs_to_skip` +- `dirs_to_skip` A list of directories which is excluded when checking or adding the headers -- `not_generated_files_to_skip` +- `not_generated_files_to_skip` A list of all the files contain 'DO NOT EDIT', but are not generated All other settings will be ignored. diff --git a/boilerplate/boilerplate.py b/boilerplate/boilerplate.py index a5866e0..5709d42 100755 --- a/boilerplate/boilerplate.py +++ b/boilerplate/boilerplate.py @@ -88,7 +88,7 @@ def is_generated_file(filename, data, regexs, files_to_skip): def match_and_delete(content, re): match = re.search(content) - if match == None: + if match is None: return content, None return re.sub("", content, 1), match.group() @@ -124,7 +124,7 @@ def file_passes(filename, refs, regexs, not_generated_files_to_skip): def file_content_passes(data, filename, ref, extension, generated, regexs): - if ref == None: + if ref is None: return True data, _ = replace_specials(data, extension, regexs) @@ -262,7 +262,7 @@ def ensure_boilerplate_file(file_name, refs, regexs, not_generated_files_to_skip new_content = '' # shebang and such - if special_header != None: + if special_header is not None: new_content += special_header # licence header diff --git a/boilerplate/boilerplate_test.py b/boilerplate/boilerplate_test.py index 3c40cb0..d49626b 100644 --- a/boilerplate/boilerplate_test.py +++ b/boilerplate/boilerplate_test.py @@ -195,7 +195,7 @@ def function_mocker(function_name, original_holder, return_value=None): # mock the function def the_mock(*args): mock_call_args.append(args) - if return_value != None: + if return_value is not None: return return_value # use the mock in place of the original implementation