Skip to content

Instantly share code, notes, and snippets.

@aljp
Created July 2, 2016 06:39
Show Gist options
  • Save aljp/7a6de6d96802047c14899927e4a373b3 to your computer and use it in GitHub Desktop.
Save aljp/7a6de6d96802047c14899927e4a373b3 to your computer and use it in GitHub Desktop.
# Pycharm formatting, incorrect indentation after start of .format(...
url(r'^(?P<url_name>[a-z][a-z0-9_]+)/users/'
r'(?P<username>{username_regex_pattern})/'
r'favorite-companies/$'.format(
username_regex_pattern=username_regex_pattern),
views.FavoriteCompanyList.as_view(),
name='favorite-company-list'),
# If you put the start of the regex on the next line pycharm autoformatting works properly
url(
r'^(?P<url_name>[a-z][a-z0-9_]+)/users/'
r'(?P<username>{username_regex_pattern})/'
r'favorite-companies/$'.format(
username_regex_pattern=username_regex_pattern),
views.FavoriteCompanyList.as_view(),
name='favorite-company-list'),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment