Fix missing in_place arg in Markdown Linter
Linter fails on Markdown files due to the former argument in_place being removed in a recent commit https://github.com/causify-ai/helpers/commit/0387ed7fa93653b9ca98396fb3580a7fa7a19ba3
@gpsaggese what is the intended new approach of formatting a file in place there? Passing the same file path to the input and output arguments?
@gpsaggese this issue has already opened here, hence not opening a redundant one.
After some investigation:
-
In the old version of
lint_notes.py, the--in_placeargument explicitly controlled whether the input file was overwritten with the linted output. -
In the current version,
--in_placehas been removed. Instead:- You can pass both
-iand-oto specify input and output files explicitly.
dev_scripts_helpers/documentation/lint_notes.py -i file1.md -o file2.md- If only
-iis provided and it points to a file (not stdin), the script defaults to in-place behavior by settingout_file = in_file.
# Lints file in-place. dev_scripts_helpers/documentation/lint_notes.py -i file1.md - You can pass both
Solution
The cause of the lint failure was due to this line in a previous commit:
https://github.com/causify-ai/helpers/blob/b32aa8b2eb8c357c2e8610aae35ddf5859023d12/linters/amp_lint_md.py#L67-L69
This used the deprecated --in_place flag, which is no longer supported in the updated lint_notes.py.
This has already been fixed in the current version of the repo by replacing it with: https://github.com/causify-ai/helpers/blob/dafdb4af43039e4ddc5eed62ba9c3cdf5f22bab9/linters/amp_lint_md.py#L66-L68
Good investigation @aangelo9