diff options
author | Xiaobo Gu <xiaobo.gu@amlogic.com> | 2015-05-28 17:12:26 +0800 |
---|---|---|
committer | Xiaobo Gu <xiaobo.gu@amlogic.com> | 2015-05-28 17:12:50 +0800 |
commit | ba2a70047b720662d3d0573d02636a34aa616d78 (patch) | |
tree | fc612d3d255258fff128cc516b8ca56edfa46a61 /scripts | |
parent | a8d5bd3cbeb97db1ae6a4013f7af39768b6cbb42 (diff) | |
download | u-boot-odroid-c1-ba2a70047b720662d3d0573d02636a34aa616d78.tar.gz |
Update coding style fix script
Change-Id: Icd5f86885df481cc611e1ca7ba0824886b2b3e35
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/amlogic/coding_style/auto_fix.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/scripts/amlogic/coding_style/auto_fix.py b/scripts/amlogic/coding_style/auto_fix.py index 5fe68977f0..d06ddcec99 100644 --- a/scripts/amlogic/coding_style/auto_fix.py +++ b/scripts/amlogic/coding_style/auto_fix.py @@ -18,6 +18,9 @@ MESSAGE_INFO_7 = "possibly incorrect mixed spaces then tabs indentation" MESSAGE_INFO_8 = "file should not have carriage returns" MESSAGE_INFO_9 = "make sure indent style matches rest of file" MESSAGE_INFO_10 = "spacing around &&" +MESSAGE_INFO_11 = "spacing around ||" +MESSAGE_INFO_12 = "spacing around >=" +MESSAGE_INFO_13 = "spacing around <=" class fixer(object): def __init__(self, filename): @@ -97,6 +100,12 @@ class fixer(object): self.message_9() if (self.cur_message.find(MESSAGE_INFO_10) >= 0): self.message_10() + if (self.cur_message.find(MESSAGE_INFO_11) >= 0): + self.message_11() + if (self.cur_message.find(MESSAGE_INFO_12) >= 0): + self.message_12() + if (self.cur_message.find(MESSAGE_INFO_13) >= 0): + self.message_13() def message_1(self): # acknowledge bug: can not fix last line with last blank character @@ -193,7 +202,9 @@ class fixer(object): cur_line_first_noblank_pos = cur_char_pos break no_blank_str = self.cur_line_content[0:cur_line_first_noblank_pos] - no_blank_str = no_blank_str.replace(" ", " ") + no_blank_str_tmp = no_blank_str.replace(" ", " ") + if (no_blank_str_tmp == no_blank_str): + no_blank_str = no_blank_str.replace(" ", " ") #print self.cur_line_content self.cur_line_content = no_blank_str + self.cur_line_content[cur_line_first_noblank_pos:cur_line_length] #print self.cur_line_content @@ -201,6 +212,15 @@ class fixer(object): def message_10(self): self.message_space_around("&&") + def message_11(self): + self.message_space_around("||") + + def message_12(self): + self.message_space_around(">=") + + def message_13(self): + self.message_space_around("<=") + def message_space_around(self, symbol): replace_symbol = [] replace_symbol.append(' ' + symbol + ' ') |