-
Notifications
You must be signed in to change notification settings - Fork 651
Checking that all files have owners. #441
Changes from 4 commits
1286070
f392398
b0fef47
fafd00d
ba376cf
7f9658f
7aa43dd
7f64eaa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,5 +34,83 @@ def test_codeowners_user_exist(): | |
assert client.get_user(user[1:]) | ||
|
||
|
||
directories_to_test = [ | ||
'examples', | ||
'keras_contrib/activations', | ||
'keras_contrib/applications', | ||
'keras_contrib/callbacks', | ||
'keras_contrib/constraints', | ||
'keras_contrib/datasets', | ||
'keras_contrib/initializers', | ||
'keras_contrib/layers', | ||
'keras_contrib/losses', | ||
'keras_contrib/metrics', | ||
'keras_contrib/optimizers', | ||
'keras_contrib/preprocessing', | ||
'keras_contrib/regularizers', | ||
'keras_contrib/wrappers' | ||
] | ||
directories_to_test = [path_to_keras_contrib / x for x in directories_to_test] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the use of pathlib instead of classic There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Less typing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test only runs on python 3 on travis btw, so it should be ok to use pathlib. |
||
|
||
pattern_exclude = [ | ||
'.gitkeep', | ||
'__init__.py' | ||
] | ||
|
||
# TODO: remove those files or find them owners. | ||
exclude = [ | ||
'examples/cifar10_clr.py', | ||
'examples/cifar10_densenet.py', | ||
'examples/cifar10_nasnet.py', | ||
'examples/cifar10_resnet.py', | ||
'examples/cifar10_ror.py', | ||
'examples/cifar10_wide_resnet.py', | ||
'examples/conll2000_chunking_crf.py', | ||
'examples/improved_wgan.py', | ||
'examples/jaccard_loss.py', | ||
'keras_contrib/activations/squash.py', | ||
'keras_contrib/callbacks/cyclical_learning_rate.py', | ||
'keras_contrib/callbacks/dead_relu_detector.py', | ||
'keras_contrib/callbacks/snapshot.py', | ||
'keras_contrib/applications/densenet.py', | ||
'keras_contrib/applications/nasnet.py', | ||
'keras_contrib/applications/resnet.py', | ||
'keras_contrib/applications/wide_resnet.py', | ||
'keras_contrib/constraints/clip.py', | ||
'keras_contrib/datasets/coco.py', | ||
'keras_contrib/datasets/conll2000.py', | ||
'keras_contrib/datasets/pascal_voc.py', | ||
'keras_contrib/initializers/convaware.py', | ||
'keras_contrib/losses/crf_losses.py', | ||
'keras_contrib/losses/dssim.py', | ||
'keras_contrib/losses/jaccard.py', | ||
'keras_contrib/layers/advanced_activations.py', | ||
'keras_contrib/layers/capsule.py', | ||
'keras_contrib/layers/convolutional.py', | ||
'keras_contrib/layers/core.py', | ||
'keras_contrib/layers/crf.py', | ||
'keras_contrib/layers/normalization.py', | ||
'keras_contrib/optimizers/ftml.py', | ||
'keras_contrib/optimizers/lars.py', | ||
'keras_contrib/optimizers/padam.py', | ||
'keras_contrib/optimizers/yogi.py', | ||
'keras_contrib/metrics/crf_accuracies.py', | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. empty line |
||
] | ||
exclude = [path_to_keras_contrib / x for x in exclude] | ||
|
||
|
||
@pytest.mark.parametrize('directory', directories_to_test) | ||
def test_all_files_have_owners(directory): | ||
files_with_owners = [x[0] for x in parse_codeowners()] | ||
for children in directory.iterdir(): | ||
if children.is_file(): | ||
if children.name in pattern_exclude: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. combiner les deux en un seul |
||
continue | ||
if children in exclude: | ||
continue | ||
assert children in files_with_owners | ||
|
||
|
||
if __name__ == '__main__': | ||
pytest.main([__file__]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it be possible to soften the tone a lil bit here? Something like "We would appreciate X" instead of "You should do X".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing, I'll change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.