diff --git a/crawler/.style.yapf b/crawler/.style.yapf new file mode 100644 index 0000000..fdfbc6b --- /dev/null +++ b/crawler/.style.yapf @@ -0,0 +1,21 @@ +[style] +based_on_style = facebook + +# Formatting options +column_limit = 88 +indent_width = 4 +use_tabs = false +continuation_indent_width = 4 + +# Spacing +spaces_around_power_operator = true +spaces_before_comment = 2 + +# Splitting rules +split_before_logical_operator = true +split_before_bitwise_operator = true +split_before_arithmetic_operator = true +split_before_expression_after_opening_paren = true +split_before_first_argument = false +split_complex_comprehension = true +allow_split_before_dict_value = true \ No newline at end of file diff --git a/crawler/README.md b/crawler/README.md new file mode 100644 index 0000000..e1b62d8 --- /dev/null +++ b/crawler/README.md @@ -0,0 +1,26 @@ +# Setup + +```bash +pip install -r requirements.txt +``` + +# Formatting + +```bash +yapf --style .style.yapf --recursive . +``` + +For VSCode - install yapf extension. +Enable formatting using yap and the style file in this repo (there may be an easier way; I put this in my user settings json): + +``` +{ + "[python]": { + "editor.formatOnSaveMode": "file", + "editor.formatOnSave": true, + "editor.defaultFormatter": "eeyore.yapf", + "editor.formatOnType": false + }, + "yapf.args": ["--style", "/home/wizard/code/realestate-crawler/crawler/.style.yapf"] +} +```