{"record":{"id":"4a87e62883d01fd5","repo":"anthropics/skills","slug":"this-module-should-not-be-run-directly","errorCode":null,"errorMessage":"This module should not be run directly.","messagePattern":"This module should not be run directly\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"info","filePath":"skills/xlsx/scripts/office/validators/base.py","lineNumber":875,"sourceCode":"                    )\n                return template_pattern.sub(\"\", text)\n            return text\n\n        for elem in xml_copy.iter():\n            if not hasattr(elem, \"tag\") or callable(elem.tag):\n                continue\n            tag_str = str(elem.tag)\n            if tag_str.endswith(\"}t\") or tag_str == \"t\":\n                continue\n\n            elem.text = process_text_content(elem.text, \"text content\")\n            elem.tail = process_text_content(elem.tail, \"tail content\")\n\n        return lxml.etree.ElementTree(xml_copy), warnings\n\n\nif __name__ == \"__main__\":\n    raise RuntimeError(\"This module should not be run directly.\")\n","sourceCodeStart":857,"sourceCodeEnd":876,"githubUrl":"https://github.com/anthropics/skills/blob/f6656c1256d5a8adfa37db9110046ef20bac644c/skills/xlsx/scripts/office/validators/base.py#L857-L876","documentation":"office/validators/base.py is a library module; running it as a script (`python base.py`) hits the `if __name__ == \"__main__\"` guard and raises RuntimeError immediately. It has no CLI entry point — validation is invoked by importing the validator classes from a driver script.","triggerScenarios":"Executing `python skills/xlsx/scripts/office/validators/base.py` directly from the repo root or an IDE 'run file' action; a launcher/build step globbing *.py and running each file.","commonSituations":"IDE run button on the open file; CI smoke tests that naively execute every .py; newcomers looking for a CLI that does not exist in this module.","solutions":["Run the package's intended entry point script instead (the office/xlsx driver scripts that import these validators)","If exploring, use `python -c 'from office.validators import base'` (with the scripts dir on sys.path) to import, not execute","Configure IDE/CI to not execute library modules"],"exampleFix":"# before\npython skills/xlsx/scripts/office/validators/base.py\n# after\npython skills/xlsx/scripts/office/validate.py target.docx  # (whichever driver imports base)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"# Not an error to handle at runtime — correct the invocation.\n# Import instead of executing: \n#   from office.validators import base","preventionTips":["Run validators via the package's driver script, not the module files","Configure IDE run configurations and CI globs to skip library modules"],"tags":["module-guard","usage-error","python"],"backgroundTag":null,"analyzedSha":"f6656c1256d5a8adfa37db9110046ef20bac644c","analyzedAt":"2026-08-14T16:09:17.493Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}