run-drc-for-cell-gds-using-magic: Rename match argument. Rename `match-directories` argument to `match-cells-directories` to better describe what it actually does. Signed-off-by: Tim 'mithro' Ansell <tansell@google.com>
diff --git a/run-drc-for-cell-gds-using-magic/action.yml b/run-drc-for-cell-gds-using-magic/action.yml index 1a842d2..d1ddf17 100644 --- a/run-drc-for-cell-gds-using-magic/action.yml +++ b/run-drc-for-cell-gds-using-magic/action.yml
@@ -28,9 +28,9 @@ description: >- A file containing a list of newline-delimited acceptable DRC errors. default: /dev/null - match-directories: + match-cell-directories: description: >- - A regex that will match subdirectories under cells to be checked. + A regex that will match cell names to be checked. default: ^.*$ known-bad: description: >- @@ -46,7 +46,7 @@ - ${{ inputs.top }} - --acceptable-errors-file - ${{ inputs.acceptable-errors-file }} - - --match-directories - - ${{ inputs.match-directories }} + - --match-cell-directories + - ${{ inputs.match-cell-directories }} - --known-bad - ${{ join(inputs.known-bad, ',') }}
diff --git a/run-drc-for-cell-gds-using-magic/run_all_drc.py b/run-drc-for-cell-gds-using-magic/run_all_drc.py index 8af9bc2..a091cb7 100644 --- a/run-drc-for-cell-gds-using-magic/run_all_drc.py +++ b/run-drc-for-cell-gds-using-magic/run_all_drc.py
@@ -150,10 +150,11 @@ ) @click.option( "-m", - "--match-directories", + "--match-cell-directories", default="^.*$", - help="A regex that will match subdirectories under cells/." - " Default: . (matches everything.)" + help="A regex that that will match cell names to be checked (which will" + " match subdirectories under cells/)." + " Default: ^.*$ (matches everything)" ) @click.option( "-b", @@ -163,10 +164,16 @@ " thus do not cause a non-zero exit upon failure." " Default: empty string (None of them.)" ) -def run_all_drc(top, acceptable_errors_file, match_directories, known_bad): +def run_all_drc( + top, + acceptable_errors_file, + match_cell_directories, + known_bad, + ): + os.chdir(top) print("Testing cells in %s directories matching /%s/…" % ( - os.getcwd(), match_directories)) + os.getcwd(), match_cell_directories)) global acceptable_errors acceptable_errors_str = open(acceptable_errors_file).read() @@ -182,7 +189,7 @@ cells = os.listdir(cells_dir) for cell in cells: - if not re.fullmatch(match_directories, cell): + if not re.fullmatch(match_cell_directories, cell): print("Skipping directory %s…" % cell) continue @@ -204,24 +211,23 @@ total += 1 cell_name, errors = future.result() - if cell_name in known_bad_list: - symbol = "✘\ufe0f" - message = "ERROR (ignored as known bad)" - else: - symbol = "❌" - message = "ERROR" - if len(errors) == 0: successes += 1 # This tick is rendered black on all major platforms except for # Microsoft. symbol = "✔\ufe0f" message = "CLEAN" + elif cell_name in known_bad_list: + symbol = "✘\ufe0f" + message = "ERROR (ignored as known bad)" + else: + symbol = "❌" + message = "ERROR" + exit_code = 65 + print("%-64s %s %s" % (cell_name, symbol, message)) if len(errors) != 0: - if cell_name not in known_bad_list: - exit_code = 65 for error in errors: print("* %s" % error[0]) for line in error[1]: