Skip to content

Commit

Permalink
Fix flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
stoivo committed Jul 6, 2019
1 parent b8f8a3d commit 60f2655
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 16 deletions.
5 changes: 1 addition & 4 deletions core/commands/amend.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import os

import sublime
from sublime_plugin import WindowCommand, TextCommand
from sublime_plugin import WindowCommand

from ..git_command import GitCommand

Expand Down
2 changes: 1 addition & 1 deletion core/commands/blame.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def parse_blame(self, blame_porcelain):
# Iterate through header keys and values.
try:
k, v = re.match(r"([^ ]+) (.+)", next_line).groups()
except AttributeError as e:
except AttributeError:
# Sometimes git-blame includes keys without values;
# since we don't care about these, simply discard.
print("Skipping blame line: " + repr(next_line))
Expand Down
1 change: 0 additions & 1 deletion core/commands/cherry_pick.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import sublime
from sublime_plugin import TextCommand

from .log import GsLogByBranchCommand
from ...common import util
Expand Down
7 changes: 3 additions & 4 deletions core/commands/inline_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from ...common.theme_generator import XMLThemeGenerator, JSONThemeGenerator
from ..git_command import GitCommand
from ..constants import MERGE_CONFLICT_PORCELAIN_STATUSES
from ...common.util import debug

HunkReference = namedtuple("HunkReference", ("section_start", "section_end", "hunk", "line_types", "lines"))

Expand Down Expand Up @@ -72,11 +71,11 @@ def run_async(self, settings=None, cached=False):
settings["git_savvy.repo_path"], settings["git_savvy.file_path"])
try:
file_binary.decode()
except UnicodeDecodeError as unicode_err:
except UnicodeDecodeError:
try:
file_binary.decode("latin-1")
diff_view.settings().set("git_savvy.inline_diff.encoding", "latin-1")
except UnicodeDecodeError as unicode_err:
except UnicodeDecodeError:
fallback_encoding = self.savvy_settings.get("fallback_encoding")
diff_view.settings().set("git_savvy.inline_diff.encoding", fallback_encoding)

Expand Down Expand Up @@ -479,7 +478,7 @@ def get_diff_from_line(self, line_no, reset):

if reset:
xhead_start = head_start - index_in_hunk + (0 if line_type == "+" else add_length_earlier_in_diff)
xnew_start = head_start - cur_hunk_begin_on_minus + index_in_hunk + add_length_earlier_in_diff - 1
# xnew_start = head_start - cur_hunk_begin_on_minus + index_in_hunk + add_length_earlier_in_diff - 1

return (
"@@ -{head_start},{head_length} +{new_start},{new_length} @@\n"
Expand Down
1 change: 0 additions & 1 deletion core/commands/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from sublime_plugin import WindowCommand
import sublime

from ...common import util
from ..git_command import GitCommand
from ..ui_mixins.quick_panel import PanelActionMixin, PanelCommandMixin
from ..ui_mixins.quick_panel import show_log_panel, show_branch_panel
Expand Down
1 change: 0 additions & 1 deletion core/commands/rebase_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class GsRebaseInteractiveTerminalCommand(TextCommand):
""" Change current lines to be change to new type """

def run(self, edit, type):
scopes = self.view.find_by_selector('meta.git-savvy.rebase-interactive.line')
for sel in self.view.sel():
line = self.view.line(sel.a)
first_space = self.view.substr(line).find(" ")
Expand Down
1 change: 0 additions & 1 deletion core/commands/reflog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from sublime_plugin import WindowCommand

from ..git_command import GitCommand
from .log import LogMixin
from ..ui_mixins.quick_panel import show_paginated_panel


Expand Down
1 change: 0 additions & 1 deletion core/commands/show_commit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os

import sublime
from sublime_plugin import WindowCommand, TextCommand

from ..git_command import GitCommand
Expand Down
1 change: 0 additions & 1 deletion core/commands/show_file_at_commit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import re
import sublime
from sublime_plugin import WindowCommand

Expand Down
2 changes: 1 addition & 1 deletion core/commands/status_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def run_async(self):
self.get_repo_path(offer_init=False) # check for ValueError
short_status = self.get_branch_status_short()
self.view.set_status("gitsavvy-repo-status", short_status)
except Exception as e:
except Exception:
self.view.erase_status("gitsavvy-repo-status")

global update_status_bar_soon
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ exclude =
tests/mockito,
tests/parameterized/,
.svn,CVS,.bzr,.hg,.git
per-file-ignores =
**/__init__.py:F401, F403

0 comments on commit 60f2655

Please sign in to comment.