From 61d6b67e621d32ea93566bd0ce9442bab89f5078 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Sat, 30 Sep 2017 18:51:24 +0200 Subject: [PATCH 1/4] Set up CI and Danger integration --- .style.yapf | 4 ++++ hello_world.py | 7 +++++++ requirements.txt | 2 ++ 3 files changed, 13 insertions(+) create mode 100644 .style.yapf create mode 100644 requirements.txt diff --git a/.style.yapf b/.style.yapf new file mode 100644 index 0000000..3bd5017 --- /dev/null +++ b/.style.yapf @@ -0,0 +1,4 @@ +[style] +COLUMN_LIMIT = 119 +INDENT_WIDTH = 4 +USE_TABS = False diff --git a/hello_world.py b/hello_world.py index 1464990..9001f3e 100644 --- a/hello_world.py +++ b/hello_world.py @@ -1,8 +1,15 @@ +def vector(dim): + import numpy as np + + + return np.random.rand(dim) + def message(): return 'Hello, Danger world!' def main(): print(message()) + print(vector(10)) if __name__ == '__main__': main() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..612ba38 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +yapf +futures From f794584116c875454afd71c1e56618ff366ca928 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Tue, 3 Oct 2017 23:22:40 +0200 Subject: [PATCH 2/4] Install gems in install section From d7857d96797a1166224f97a6a3b6de92bed3efae Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Wed, 4 Oct 2017 00:37:17 +0200 Subject: [PATCH 3/4] Restore installation of YAPF --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c3d82fe..88760b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,8 @@ cache: - pip - bundler install: -- bundle install + - pip install -r requirements.txt + - bundle install script: -- bundle exec danger -- python hello_world.py + - bundle exec danger + - python hello_world.py From ed2dabac3159fa6e7fd5d7d868282007393a6776 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Wed, 4 Oct 2017 00:40:09 +0200 Subject: [PATCH 4/4] Update Gemfile.lock --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ee40883..faf0ad4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/robertodr/danger-code_style_validation.git - revision: de63c3daee20a8611a6216ac35e77327eba5cd50 + revision: 6978bba01500f30294aab14db9c36298979f7d5b branch: yapf specs: danger-code_style_validation (0.2.0)