MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / DoxygenCheckRun

Class DoxygenCheckRun

scripts/format_code.py:129–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127
128
129class DoxygenCheckRun:
130 def __init__(self, folder, error_diff=False, strategy="all", file_list=None):
131 self.folder = folder
132 self.error_diff=error_diff
133 self.strategy = strategy
134 self.file_list = file_list
135
136 def error_on_diff(self, msg):
137 retval = 0
138 if self.error_diff:
139 diff = self.shell.run_single_to_str("git diff")
140 if len(diff) > 0:
141 retval = -1
142 logger.error(diff)
143 logger.error("\n"+msg)
144 return retval
145
146 def run(self):
147 retval = 0
148 self.shell = Shell()
149 self.shell.save_cwd()
150 this_dir = os.path.dirname(__file__)
151 self.shell.cd(self.folder)
152 self.shell.prepend_env("PATH","%s/../bin" % this_dir)
153
154 to_check = ""
155 if self.strategy != "all":
156 to_check, _ = CopyrightCheckRun.get_files(self.folder, self.strategy, self.file_list)
157 #FIXME: Exclude shaders!
158
159 logger.info("Running ./scripts/format_doxygen.py")
160 logger.debug(format_doxygen.main(*to_check))
161 retval = self.error_on_diff("Doxygen comments badly formatted (check above diff output for more details) try to run ./scripts/format_doxygen.py on your patch and resubmit")
162 if retval != 0:
163 raise Exception("format-code failed with error code %d" % retval)
164
165class CopyrightCheckRun:
166 @staticmethod

Callers 1

run_fix_code_formattingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected