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

Commit 9002d4d

Browse files
committed
Log error directly in function def
1 parent 2f4825a commit 9002d4d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

script/formatting/formatter.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@ def format_file(file_path, update_header, clang_format_code):
9999
file.write(file_data)
100100

101101
elif clang_format_code:
102-
if clang_format(file_path) is None:
103-
LOG.error("clang-format seems not installed")
104-
exit()
102+
clang_format(file_path)
105103

106104
#END WITH
107105
#END FORMAT__FILE(FILE_NAME)

script/helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ def clang_check(file_path):
8989
def clang_format(file_path):
9090
"""Formats the file at file_path"""
9191
if CLANG_FORMAT is None:
92-
return False
92+
LOG.error("clang-format seems not installed")
93+
exit()
94+
9395
formatting_command = CLANG_COMMAND_PREFIX + ["-i", file_path]
9496
LOG.info(' '.join(formatting_command))
9597
subprocess.call(formatting_command)
96-
return True

src/main/peloton/peloton.cpp

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

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

0 commit comments

Comments
 (0)