Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions resources/module_example1/demo/demo.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
</odoo>
<odoo />
12 changes: 6 additions & 6 deletions resources/module_example1/views/views.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- explicit list view definition -->
<!--
<!--
<record model="ir.ui.view" id="module_example1.list">
<field name="name">module_example1 list</field>
<field name="model">module_example1.module_example1</field>
Expand All @@ -16,7 +16,7 @@
-->

<!-- actions opening views on models -->
<!--
<!--
<record model="ir.actions.act_window" id="module_example1.action_window">
<field name="name">module_example1 window</field>
<field name="res_model">module_example1.module_example1</field>
Expand All @@ -25,7 +25,7 @@
-->

<!-- server action to the one above -->
<!--
<!--
<record model="ir.actions.server" id="module_example1.action_server">
<field name="name">module_example1 server</field>
<field name="model_id" ref="model_module_example1_module_example1"/>
Expand All @@ -41,16 +41,16 @@
-->

<!-- Top menu item -->
<!--
<!--
<menuitem name="module_example1" id="module_example1.menu_root"/>
-->
<!-- menu categories -->
<!--
<!--
<menuitem name="Menu 1" id="module_example1.menu_1" parent="module_example1.menu_root"/>
<menuitem name="Menu 2" id="module_example1.menu_2" parent="module_example1.menu_root"/>
-->
<!-- actions -->
<!--
<!--
<menuitem name="List" id="module_example1.menu_1_list" parent="module_example1.menu_1"
action="module_example1.action_window"/>
<menuitem name="Server to list" id="module_example1" parent="module_example1.menu_2"
Expand Down
15 changes: 15 additions & 0 deletions src/pre_commit_vauxoo/cfg/.oca_hooks_prettier.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/** @type {import('prettier').Config} */

const config = {
// https://github.com/prettier/prettier/issues/15388#issuecomment-1717746872
plugins: [require.resolve("@prettier/plugin-xml")],
bracketSpacing: false,
printWidth: 119,
proseWrap: "always",
semi: true,
trailingComma: "es5",
xmlWhitespaceSensitivity: "preserve",
xmlSelfClosingSpace: true,
};

module.exports = config;
20 changes: 13 additions & 7 deletions src/pre_commit_vauxoo/cfg/.pre-commit-config-autofix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exclude: |
)
default_language_version:
python: python3
node: "14.13.0"
node: "22.9.0"
repos:
- repo: https://github.com/OCA/odoo-pre-commit-hooks
rev: v0.2.5
Expand Down Expand Up @@ -55,17 +55,23 @@ repos:
- --remove-all-unused-imports
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
- repo: local
hooks:
- id: prettier
name: prettier (with plugin-xml)
additional_dependencies:
- "[email protected]"
- "@prettier/[email protected]"
entry: prettier
args:
- --plugin=@prettier/plugin-xml
- --write
- --list-different
- --ignore-unknown
# use this specific name because it is already listed in our .gitignore
- --config=.oca_hooks_prettier.config.cjs
types: [text]
files: \.(js|xml)$
language: node
additional_dependencies:
- "[email protected]"
- "@prettier/[email protected]"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand Down
8 changes: 0 additions & 8 deletions src/pre_commit_vauxoo/cfg/.prettierrc.yml

This file was deleted.

4 changes: 2 additions & 2 deletions tests/test_pre_commit_vauxoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_chdir(self):
def test_exclude_lint_path(self):
os.environ["PRECOMMIT_HOOKS_TYPE"] = "all"
os.environ["BLACK_SKIP_STRING_NORMALIZATION"] = "false"
os.environ["EXCLUDE_LINT"] = "module_example1/models"
os.environ["EXCLUDE_LINT"] = "module_example1/models,module_warnings1/"
result = self.runner.invoke(main, [])
self.assertEqual(result.exit_code, 0, "Exited with error %s - %s" % (result, result.output))
with open(os.path.join(self.tmp_dir, "pyproject.toml")) as f_pyproject:
Expand All @@ -122,7 +122,7 @@ def test_disable_lints(self):

def test_exclude_autofix(self):
os.environ["PRECOMMIT_HOOKS_TYPE"] = "all"
os.environ["EXCLUDE_AUTOFIX"] = "module_example1/demo/,module_autofix1/"
os.environ["EXCLUDE_AUTOFIX"] = "module_example1/demo/,module_autofix1/,module_warnings1/"
os.environ["BLACK_SKIP_STRING_NORMALIZATION"] = "true"
result = self.runner.invoke(main, [])
self.assertEqual(result.exit_code, 0, "Exited with error %s - %s" % (result, result.output))
Expand Down