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

[WIP] Rework tests in CI #210

Closed
wants to merge 2 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
6 changes: 4 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
name: 'Release'

on:
push:
branches: [master]
workflow_run:
workflows: ["pre-commit"]
types:
- completed

jobs:
release:
Expand Down
26 changes: 26 additions & 0 deletions tests/find_dupes
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python3
#
"""Check the compiled lscolors.sh file for duplicate extensions."""
import sys
import re
from collections import Counter


def main() -> int:
with open("../lscolors.sh", "r") as f:
data = next(f)

extensions = re.findall(r"\*\.(.*?)=", data)

if duplicates := [ext for ext, count in Counter(extensions) if count > 1]:
print(f"Duplicates found: {', '.join(duplicates)}")
return 1
else:
print("No duplicates found.")
return 0


if __name__ == "__main__":
sys.exit(main())

# EOF
8 changes: 0 additions & 8 deletions tests/no_dupes

This file was deleted.

Loading