Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce "black" code formatter to the repo #262

Closed
wants to merge 8 commits into from

Conversation

beniwohli
Copy link
Contributor

@beniwohli beniwohli commented Jul 17, 2018

  • add pyproject.toml with exclude for wrapt, and line length of 120
  • add pre-commit config
  • update isort configuration to make it compatible with black
  • update flake8 configuration to make it compatible with black
  • add note to CONTRIBUTING.md about use of black
  • add test to linter stage that tests that black . --diff is empty

@@ -31,7 +29,7 @@ def skip_to(start, tokens, value_sequence):
break
else:
# Match
return tokens[start:i + len(value_sequence)]
return tokens[start : i + len(value_sequence)]

This comment was marked as outdated.

return (
(not django_settings.DEBUG or client.config.debug)
and middleware
and "elasticapm.contrib.django.middleware.TracingMiddleware" in middleware

This comment was marked as outdated.

middleware and 'elasticapm.contrib.django.middleware.TracingMiddleware' in middleware)
return (
(not django_settings.DEBUG or client.config.debug)
and middleware

This comment was marked as outdated.

post_context = [line.strip('\r\n') for line in source[(lineno + 1):upper_bound + 1]]
pre_context = [line.strip("\r\n") for line in source[lower_bound:lineno]]
context_line = source[lineno].strip("\r\n")
post_context = [line.strip("\r\n") for line in source[(lineno + 1) : upper_bound + 1]]

This comment was marked as outdated.

[l.strip('\r\n') for l in lines[offset + 1:]] if len(lines) > offset else []
[l.strip("\r\n") for l in lines[0:offset]],
lines[offset].strip("\r\n"),
[l.strip("\r\n") for l in lines[offset + 1 :]] if len(lines) > offset else [],

This comment was marked as outdated.

@beniwohli beniwohli force-pushed the black branch 2 times, most recently from af91982 to 0e1a94a Compare July 17, 2018 14:41
Signed-off-by: Benjamin Wohlwend <beni@elastic.co>
Signed-off-by: Benjamin Wohlwend <beni@elastic.co>
@beniwohli
Copy link
Contributor Author

merged in a83e3b6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants