Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 38dbf46

Browse files
committed
Add sys.path.append() calls
1 parent 9002d4d commit 38dbf46

File tree

9 files changed

+13
-56
lines changed

9 files changed

+13
-56
lines changed

script/__init__.py

Whitespace-only changes.

script/formatting/__init__.py

Whitespace-only changes.

script/formatting/formatter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
import subprocess
1515

1616
from functools import reduce
17-
from script.helpers import CLANG_FORMAT, PELOTON_DIR, CLANG_FORMAT_FILE, LOG,\
17+
18+
# Following is done so that we can import from ../helpers.py
19+
sys.path.append(
20+
os.path.abspath(os.path.dirname(__file__)).replace('/formatting', '')
21+
)
22+
from helpers import CLANG_FORMAT, PELOTON_DIR, CLANG_FORMAT_FILE, LOG,\
1823
clang_format
1924

2025
## ==============================================

script/git-hooks/README.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

script/git-hooks/pre-commit

Lines changed: 0 additions & 30 deletions
This file was deleted.

script/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from functools import reduce
1010

1111
CODE_SOURCE_DIR = os.path.abspath(os.path.dirname(__file__))
12-
PELOTON_DIR = CODE_SOURCE_DIR.rstrip('/script')
12+
PELOTON_DIR = CODE_SOURCE_DIR.replace('/script', '')
1313
CLANG_FORMAT_FILE = os.path.join(PELOTON_DIR, ".clang-format")
1414

1515
FORMATTING_FILE_WHITELIST = [

script/validators/__init__.py

Whitespace-only changes.

script/validators/source_validator.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
import mmap
99
import glob
1010

11-
from script.helpers import clang_check, PELOTON_DIR, LOG
11+
# Following is done so that we can import from ../helpers.py
12+
sys.path.append(
13+
os.path.abspath(os.path.dirname(__file__)).replace('/validators', '')
14+
)
15+
from helpers import clang_check, PELOTON_DIR, LOG
1216

1317
## ==============================================
1418
## CONFIGURATION

src/main/peloton/peloton.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ int main(int argc, char *argv[]) {
3434

3535
// Print settings
3636
if (peloton::settings::SettingsManager::GetBool(
37-
peloton::settings::SettingId::display_settings)) {
38-
auto &settings = peloton::settings::SettingsManager::GetInstance();
37+
peloton::settings::SettingId::display_settings)) {auto &settings = peloton::settings::SettingsManager::GetInstance();
3938
settings.ShowInfo();
4039
}
4140

0 commit comments

Comments
 (0)