mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-21 09:07:50 -06:00
chore: read every site module in the text guards
Three guards named generate_site.py or a fixed list of four modules, while page text now lives in twelve site modules and packreadme.py. The list is a glob. Read that way, the pack README said "all of theirs" twice.
This commit is contained in:
1 parent
9b871db83a
commit
6a79281e07
4 files changed
+30
-12
No files matched your search
@@ -50,15 +50,16 @@ class EveryPageAddressesPlatformsAsPeers(unittest.TestCase):
|
||||
text every site generator writes, docstrings and bare identifiers aside."""
|
||||
|
||||
WORDS = ("their file", "theirs", "of ours", "corrected", "left out", "drift")
|
||||
SOURCES = ("generate_site.py", "siterender.py", "sitesources.py", "siteexports.py")
|
||||
|
||||
def test_no_page_text_judges_another_project(self):
|
||||
import ast
|
||||
import re
|
||||
|
||||
from tests.sitepages import generator_sources
|
||||
|
||||
found = []
|
||||
for name in self.SOURCES:
|
||||
tree = ast.parse((REPO_ROOT / "scripts" / name).read_text(encoding="utf-8"))
|
||||
for source in generator_sources():
|
||||
name = source.name
|
||||
tree = ast.parse(source.read_text(encoding="utf-8"))
|
||||
docstrings = {
|
||||
id(node.body[0].value) for node in ast.walk(tree)
|
||||
if isinstance(node, (ast.Module, ast.ClassDef, ast.FunctionDef,
|
||||
|
||||
Reference in new issue
Block a user