Skip to content

Commit

Permalink
Use Makefile to substitute install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Clcanny committed Jun 25, 2020
1 parent efce995 commit 0165b4d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 40 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*.pyc
thirdparty/**
config/**
build/**
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ isort: $(BUILD_VIRTUAL_ENV)/bin/isort

yapf: $(BUILD_VIRTUAL_ENV)/bin/yapf
$(BUILD_VIRTUAL_ENV)/bin/yapf --help
mkdir -p config
$(BUILD_VIRTUAL_ENV)/bin/yapf --style="google" --style-help > config/yapf.cfg

check: isort yapf

Expand Down
34 changes: 0 additions & 34 deletions install.sh

This file was deleted.

9 changes: 4 additions & 5 deletions python/python_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ class PythonFormatter(AbstractFormatter):

def __init__(self):
super(self.__class__, self).__init__()
yapfDir = self._getAbsPath(self._getRootDir(), "thirdparty", "yapf")
self._yapf = "PYTHONPATH={}/build/lib/python {}/build/bin/yapf".format(
yapfDir, yapfDir)
self._yapf = self._getAbsPath(self._getRootDir(), "build/venv/bin/yapf")
self._isort = self._getAbsPath(self._getRootDir(),
"build/venv/bin/isort")

def _getGuideFilename(self):
# return vim.eval("s:VimFormatterPythonStyle")
return None

def _getFormatCommand(self, formattedFilename, guideFilename):
guideFilename = vim.eval("g:VimFormatterPythonStyle")
isort = "{}/build/venv/bin/isort".format(self._getRootDir())
cmd = '{} --stdout "{}" | {} --style="{}"'.format(
isort, formattedFilename, self._yapf, guideFilename)
self._isort, formattedFilename, self._yapf, guideFilename)
return cmd

0 comments on commit 0165b4d

Please sign in to comment.