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/.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 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) 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