Debian Codegraph @

test/sanity/code-smell/obsolete-files.py

raw
1 """Prevent files from being added to directories that are now obsolete."""
2
3 from __future__ import annotations
4
5 import os
6 import sys
7
8
9 def main():
10 """Main entry point."""
11 paths = sys.argv[1:] or sys.stdin.read().splitlines()
12
13 for path in paths:
14 print('%s: directory "%s/" is obsolete and should not contain any files' % (path, os.path.dirname(path)))
15
16
17 if __name__ == '__main__':
18 main()