wads.docs_ignore¶
Remove the legacy docs/* line from a repo’s .gitignore (i2mint/wads#249).
Old wads templates ignored the whole docs/ directory, which silently drops
hand-written docs. fix_docs_ignore() deletes those lines, keeps build output
ignored with docs/_build/, and first checks that no file under docs/ that is
ignored today would show up as untracked afterwards.
>>> new_gitignore("*.pyc\ndocs/*\n")
'*.pyc\ndocs/_build/\n'
>>> new_gitignore("docs/*\ndocs/_build/\n")
'docs/_build/\n'
>>> new_gitignore("*.pyc\n") is None
True
Module Attributes
build output stays ignored. |
Functions
|
Files under |
|
Plan (and with |
|
|
- wads.docs_ignore.KEEP_IGNORED = 'docs/_build/'¶
build output stays ignored.
- Type:
What replaces the legacy line
- wads.docs_ignore.exposed_files(repo)[source]¶
Files under
docs/that are ignored now and would not stay ignored bydocs/_build/.
- wads.docs_ignore.fix_docs_ignore(repo='.', *, apply=False, force=False)[source]¶
Plan (and with
apply=Truewrite) the removal of the legacydocs/*line.Returns
{"status": ..., "exposed": [...]}where status is"clean"(nothing to do),"blocked"(files underdocs/would be exposed; passforce=Trueto proceed),"planned"or"fixed".- Return type: