Skip to content

Commit c941d74

Browse files
committed
Remove all shebangs from Python modules and checker
As discussed, Python modules which aren't intended to be invoked as scripts should not include a shebang line. Update CONTRIBUTING.md and the checker script. This script now includes a list SKIP_FILES for files that should not be checked for boilerplate template. The tests will now fail if a Python module has a shebang line. Scripts which should have a shebang line and exists in the directory `hack` can be ignored by adding them to the SKIP_FILES list.
1 parent 4b8e89f commit c941d74

26 files changed

+25
-53
lines changed

CONTRIBUTING.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Thanks for taking the time to join our community and start contributing!
44

5-
Any changes to utilites in this repo should be send as a PR to this repo.
5+
Any changes to utilities in this repo should be send as a PR to this repo.
66
After the PR is merged, developers should create another PR in the main repo to update the submodule.
77
See [this document](https://github.com/kubernetes-client/python/blob/master/devel/submodules.md) for more guidelines.
88

@@ -11,3 +11,19 @@ provides detailed instructions on how to get your ideas and bug fixes seen and a
1111

1212
Please remember to sign the [CNCF CLA](https://github.com/kubernetes/community/blob/master/CLA.md) and
1313
read and observe the [Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
14+
15+
## Adding new Python modules or Python scripts
16+
If you add a new Python module please make sure it includes the correct header
17+
as found in:
18+
```
19+
hack/boilerplate/boilerplate.py.txt
20+
```
21+
22+
This module should not include a shebang line.
23+
24+
If you add a new Python helper script intended for developers usage, it should
25+
go into the directory `hack` and include a shebang line `#!/usr/bin/env python`
26+
at the top in addition to rest of the boilerplate text as in all other modules.
27+
28+
In addition this script's name should be added to the list
29+
`SKIP_FILES` at the top of hack/boilerplate/boilerplate.py.

config/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
# Copyright 2016 The Kubernetes Authors.
42
#
53
# Licensed under the Apache License, Version 2.0 (the "License");

config/config_exception.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
# Copyright 2016 The Kubernetes Authors.
42
#
53
# Licensed under the Apache License, Version 2.0 (the "License");

config/dateutil.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
# Copyright 2017 The Kubernetes Authors.
42
#
53
# Licensed under the Apache License, Version 2.0 (the "License");

config/dateutil_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
# Copyright 2016 The Kubernetes Authors.
42
#
53
# Licensed under the Apache License, Version 2.0 (the "License");

config/exec_provider.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
# Copyright 2018 The Kubernetes Authors.
42
#
53
# Licensed under the Apache License, Version 2.0 (the "License");

config/exec_provider_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
# Copyright 2018 The Kubernetes Authors.
42
#
53
# Licensed under the Apache License, Version 2.0 (the "License");

config/incluster_config.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
# Copyright 2016 The Kubernetes Authors.
42
#
53
# Licensed under the Apache License, Version 2.0 (the "License");

config/incluster_config_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
# Copyright 2016 The Kubernetes Authors.
42
#
53
# Licensed under the Apache License, Version 2.0 (the "License");

config/kube_config.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
# Copyright 2018 The Kubernetes Authors.
42
#
53
# Licensed under the Apache License, Version 2.0 (the "License");

0 commit comments

Comments
 (0)