Files
computer-playbook/tests/integration/test_filename_conventions.py
Kevin Veen-Birkenbach 2fccebbd1f Enforce uppercase README.md and TODO.md filenames
- Renamed all Readme.md → README.md
- Renamed all Todo.md → TODO.md
- Added integration test (tests/integration/test_filename_conventions.py) to automatically check naming convention.

Background:
Consistency in file naming (uppercase README.md and TODO.md) avoids issues with case-sensitive filesystems and ensures desktop cards (e.g. Pretix) are properly included.
Ref: https://chatgpt.com/share/68b1d135-c688-800f-9441-46a3cbfee175
2025-08-29 18:11:53 +02:00

28 lines
895 B
Python

import os
import unittest
class TestFilenameConventions(unittest.TestCase):
"""
Integration test to ensure README.md and TODO.md files
are always written in uppercase (README.md / TODO.md).
"""
def test_readme_and_todo_filenames_are_uppercase(self):
bad_files = []
for root, _, files in os.walk("."):
for filename in files:
lower = filename.lower()
if lower in ("readme.md", "todo.md"):
if filename not in ("README.md", "TODO.md"):
bad_files.append(os.path.join(root, filename))
msg = (
"The following files violate uppercase naming convention "
"(must be README.md or TODO.md):\n- " + "\n- ".join(bad_files)
) if bad_files else None
self.assertEqual(bad_files, [], msg)
if __name__ == "__main__":
unittest.main()