https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39353
Emily Lamancusa (emlam) <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179387|0 |1 is obsolete| | --- Comment #9 from Emily Lamancusa (emlam) <[email protected]> --- Created attachment 179480 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179480&action=edit Bug 39353: Prevent tidy.pl to empty template files In ktd context: if host's node_modules ktd has been generated prior to bug 38644, the template-toolkit's prettier plugin is not there and prettier will empty the file. It seems to be a prettier bug, and the following behaviour is confusing: From the host: % yarn run prettier --write koha-tmpl/intranet-tmpl/prog/en/modules/test.tt yarn run v1.22.22 $ prettier koha-tmpl/intranet-tmpl/prog/en/modules/test.tt [error] Cannot find module '@koha-community/prettier-plugin-template-toolkit' [error] Require stack: [error] - /home/jonathan/workspace/koha/node_modules/prettier/index.js [error] - /home/jonathan/workspace/koha/node_modules/prettier/cli.js [error] - /home/jonathan/workspace/koha/node_modules/prettier/bin-prettier.js error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. => The file is not modified Within ktd: $ yarn run prettier --write koha-tmpl/intranet-tmpl/prog/en/modules/test.tt yarn run v1.22.22 $ prettier --write koha-tmpl/intranet-tmpl/prog/en/modules/test.tt koha-tmpl/intranet-tmpl/prog/en/modules/test.tt 6ms Done in 0.39s. => No error, and the file is emptied! It seems that the plugin is found by prettier but not used (?) Test plan: 1. Follow this from step 1 to 14 https://gitlab.com/koha-community/koha-testing-docker/-/issues/483 2. Apply patch 3. misc/devel/tidy.pl --no-write koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt It should print the new error message 4. Make a change to a .tt file, commit 5. There will be a message about and issue with prettier. But it will still commit. It's expect. 6. Inspect and see that the commit has the changes Signed-off-by: Victor Grousset/tuxayo <[email protected]> Signed-off-by: Emily Lamancusa <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
