Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test 2 #7

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<a href="#"><img src=".github/assets/paradise.png" alt="Paradise Station"></a>

## <p align="center">Welcome to the main repository for the Paradise Station version of [Space Station 13](https://spacestation13.com/).</p>

test123
<p align="center">
<a href="https://github.com/ParadiseSS13/Paradise/actions?query=workflow%3ACI"><img src="https://github.com/ParadiseSS13/Paradise/workflows/CI/badge.svg" alt="CI"></a>
<a href="https://github.com/ParadiseSS13/Paradise/actions?query=workflow%3A%22Render+Nanomaps%22"><img src="https://github.com/ParadiseSS13/Paradise/workflows/Render%20Nanomaps/badge.svg" alt="Render Nanomaps"></a>
Expand Down
46 changes: 25 additions & 21 deletions tools/ci/check_grep2.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys
import time
from collections import namedtuple

from concurrent.futures import ProcessPoolExecutor
Failure = namedtuple("Failure", ["filename", "lineno", "message"])

RED = "\033[0;31m"
Expand Down Expand Up @@ -212,6 +212,27 @@ def check_uid_parameters(idx, line):
check_uid_parameters,
]

def lint_file(code_filepath: str) -> list[Failure]:
all_failures = []
with open(code_filepath, encoding="UTF-8") as code:
filename = code_filepath.split(os.path.sep)[-1]

extra_checks = []
if filename != IGNORE_515_PROC_MARKER_FILENAME:
extra_checks.append(check_515_proc_syntax)
if filename != IGNORE_ATOM_ICON_FILE:
extra_checks.append(check_manual_icon_updates)

last_line = None
for idx, line in enumerate(code):
for check in CODE_CHECKS + extra_checks:
if failures := check(idx, line):
all_failures += [Failure(code_filepath, lineno, message) for lineno, message in failures]
last_line = line

if last_line and last_line[-1] != '\n':
all_failures.append(Failure(code_filepath, idx + 1, "Missing a trailing newline"))
return all_failures

if __name__ == "__main__":
print("check_grep2 started")
Expand All @@ -225,26 +246,9 @@ def check_uid_parameters(idx, line):
dm_files = [sys.argv[1]]

all_failures = []

for code_filepath in dm_files:
with open(code_filepath, encoding="UTF-8") as code:
filename = code_filepath.split(os.path.sep)[-1]

extra_checks = []
if filename != IGNORE_515_PROC_MARKER_FILENAME:
extra_checks.append(check_515_proc_syntax)
if filename != IGNORE_ATOM_ICON_FILE:
extra_checks.append(check_manual_icon_updates)

last_line = None
for idx, line in enumerate(code):
for check in CODE_CHECKS + extra_checks:
if failures := check(idx, line):
all_failures += [Failure(code_filepath, lineno, message) for lineno, message in failures]
last_line = line

if last_line and last_line[-1] != '\n':
all_failures.append(Failure(code_filepath, idx + 1, "Missing a trailing newline"))
with ProcessPoolExecutor() as executor:
for failures in executor.map(lint_file, dm_files):
all_failures += failures

if all_failures:
exit_code = 1
Expand Down