Document how to integrate in pre-commit with plugins
See original GitHub issueEnvironments:
- Prettier Version: 1.19.1
- Running Prettier via: pre-commit
- Runtime: node v12.13.1
- Operating System: Linux
Steps to reproduce:
All I want to do is to integrate the prettier-xml plugin into pre-commit.
I tried with this, but it doesn’t work:
- repo: https://github.com/prettier/prettier
rev: "1.19.1"
hooks:
- id: prettier
name: prettier xml plugin
additional_dependencies:
- "@prettier/plugin-xml@0.5.0"
args:
- --with-node-modules
files: \.xml$
Expected behavior: Reformat xml files
Actual behavior:
Running pre-commit run -a
:
prettier xml plugin......................................................Failed
hookid: prettier
[error] No parser could be inferred for file: web_responsive/views/web.xml
[error] No parser could be inferred for file: web_responsive/static/src/xml/apps.xml
[error] No parser could be inferred for file: web_notify/views/res_users_demo.xml
[error] No parser could be inferred for file: web_responsive/static/src/xml/form_view.xml
[error] No parser could be inferred for file: web_notify/views/web_notify.xml
[error] No parser could be inferred for file: web_tree_many2one_clickable/views/assets.xml
[error] No parser could be inferred for file: web_dialog_size/static/src/xml/web_dialog_size.xml
[error] No parser could be inferred for file: web_environment_ribbon/view/base_view.xml
[error] No parser could be inferred for file: web_dialog_size/templates/assets.xml
[error] No parser could be inferred for file: web_ir_actions_act_view_reload/views/web_ir_actions_act_view_reload.xml
[error] No parser could be inferred for file: web_responsive/views/assets.xml
[error] No parser could be inferred for file: web_responsive/views/res_users.xml
[error] No parser could be inferred for file: web_responsive/static/src/xml/navbar.xml
[error] No parser could be inferred for file: web_environment_ribbon/data/ribbon_data.xml
[error] No parser could be inferred for file: web_decimal_numpad_dot/views/web_decimal_numpad_dot.xml
[error] No parser could be inferred for file: web_widget_bokeh_chart/views/web_widget_bokeh_chart.xml
Workaround:
Configuration from https://github.com/prettier/plugin-xml/issues/17#issuecomment-555445966 works, but I guess that’s not what you want to recommend to use.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
pre-commit
Once you have pre-commit installed, adding pre-commit plugins to your project is done with the .pre-commit-config.yaml configuration file.
Read more >4 pre-commit Plugins to Automate Code Reviewing and ...
You can add different plugins to your pre-commit pipeline. Once your files are committed, they will be checked by these plugins. Unless all ......
Read more >Pre-commit integration — Pylint 2.12.2 documentation
Pre-commit integration ¶ ; pylint needs to import modules and dependencies to work correctly, the hook only works with a local installation of ......
Read more >Automatically format and lint code with pre-commit - Interrupt
The best way to document a project's style is to have a tool automate it. If a pull request has any style violations,...
Read more >Pre-commit Hook - Prettier
You can use Prettier with a pre-commit tool. This can re-format your files that are marked as “staged” via `git add` before you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
fixed by https://github.com/prettier/prettier/pull/7508
This works for me:
awesome! thanks a ton @fisker and @thorn0 🎉