Skip to content

Commit

Permalink
Merge ca356a1 into 7fd517b
Browse files Browse the repository at this point in the history
  • Loading branch information
stoivo committed Jul 7, 2019
2 parents 7fd517b + ca356a1 commit 82c4eb5
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ before_install:
install:
- sh travis.sh bootstrap
- sh travis.sh install_package_control
- pip3 install python-coveralls pycodestyle;
- pip3 install python-coveralls flake8;

script:
- sh travis.sh run_tests --coverage
- sh travis.sh run_syntax_tests
- pycodestyle --statistics --count
- flake8 cmdbox

after_success:
- coveralls
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ install:
- ps: .\appveyor.ps1 "install_package_control" -verbose
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- ps: python -m pip install --upgrade pip
- ps: pip install pycodestyle
- ps: pip install flake8

build: off

test_script:
- ps: .\appveyor.ps1 "run_tests" -verbose
- ps: .\appveyor.ps1 "run_syntax_tests" -verbose
- ps: pycodestyle --statistics --count
- ps: flake8 cmdbox
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 @@ -105,11 +104,11 @@ def run(self, settings=None, cached=False, match_current_position=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 @@ -509,7 +508,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
11 changes: 2 additions & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
[pycodestyle]
count = False
ignore = E401, E731, W503, W504
max-line-length = 120
exclude =
tests/mockito,
tests/parameterized/,
.svn,CVS,.bzr,.hg,.git

[flake8]
max-line-length = 120
ignore =
Expand All @@ -19,3 +10,5 @@ exclude =
tests/mockito,
tests/parameterized/,
.svn,CVS,.bzr,.hg,.git
per-file-ignores =
**/__init__.py:F401, F403

0 comments on commit 82c4eb5

Please sign in to comment.