Skip to content

Commit

Permalink
Run auto-pep8 format code
Browse files Browse the repository at this point in the history
  • Loading branch information
jonlabelle committed May 7, 2024
1 parent f9be844 commit b1f0b47
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions JsPrettier.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def run(self, edit, save_file=False, auto_format_prettier_config_path=None):
st_status_message('Selection(s) formatted.')

def format_code(self, source, node_path, prettier_cli_path, prettier_options, view, provide_cursor=False,
is_selection=False):
is_selection=False):

self._error_message = None

Expand All @@ -401,15 +401,15 @@ def format_code(self, source, node_path, prettier_cli_path, prettier_options, vi
# automatically prepend the environment detected node[.exe|.cmd] path to
# the generated command (see #146 --no-bin-links).
cmd = [resolve_node_path(view.file_name())] \
+ [prettier_cli_path] \
+ prettier_options
+ [prettier_cli_path] \
+ prettier_options
elif is_str_none_or_empty(node_path):
cmd = [prettier_cli_path] \
+ prettier_options
+ prettier_options
else:
cmd = [node_path] \
+ [prettier_cli_path] \
+ prettier_options
+ [prettier_cli_path] \
+ prettier_options

try:
format_debug_message('Prettier CLI Command', list_to_str(cmd), debug_enabled(view))
Expand Down Expand Up @@ -497,7 +497,7 @@ def is_enabled(self):
return self.should_show_plugin()

def parse_prettier_options(self, view, parsed_additional_cli_args, prettier_config_path, has_custom_config_defined,
has_no_config_defined, prettier_ignore_filepath, source_file_path):
has_no_config_defined, prettier_ignore_filepath, source_file_path):
prettier_options = []

#
Expand Down Expand Up @@ -671,7 +671,7 @@ def has_syntax_error(error_output):
def is_source_js(view):
scopename = view.scope_name(view.sel()[0].b)
if scopename.startswith('source.js') or contains('source.js.embedded.html', scopename) \
or contains('source.css.embedded.js', scopename):
or contains('source.css.embedded.js', scopename):
return True
return False

Expand Down Expand Up @@ -702,7 +702,7 @@ def is_css(view):
return False
scopename = view.scope_name(view.sel()[0].b)
if scopename.startswith('source.css') or filename.endswith('.css') \
or contains('meta.selector.css', scopename) or contains('source.css.embedded.html', scopename):
or contains('meta.selector.css', scopename) or contains('source.css.embedded.html', scopename):
return True
return False

Expand Down Expand Up @@ -773,8 +773,8 @@ def is_html(view):
return False
scopename = view.scope_name(0)
if scopename.startswith('text.html.markdown') \
or scopename.startswith('text.html.vue') \
or filename.endswith('component.html'):
or scopename.startswith('text.html.vue') \
or filename.endswith('component.html'):
return False
if scopename.startswith('text.html') or filename.endswith('.html') or filename.endswith('.htm'):
return True
Expand Down

0 comments on commit b1f0b47

Please sign in to comment.