oca-odoo-pre-commit-hooks 0.2.27__tar.gz → 0.2.29__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/PKG-INFO +265 -107
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/README.md +251 -106
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/setup.py +1 -1
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_odoo_pre_commit_hooks.egg-info/PKG-INFO +265 -107
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_odoo_pre_commit_hooks.egg-info/SOURCES.txt +4 -0
- oca_odoo_pre_commit_hooks-0.2.29/src/oca_pre_commit_hooks/__init__.py +1 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/checks_odoo_module.py +28 -4
- oca_odoo_pre_commit_hooks-0.2.29/src/oca_pre_commit_hooks/checks_odoo_module_scss.py +357 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/checks_odoo_module_xml.py +222 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/tests/test_checks.py +27 -0
- oca_odoo_pre_commit_hooks-0.2.29/tests/test_node_xml.py +273 -0
- oca_odoo_pre_commit_hooks-0.2.29/tests/test_scss.py +133 -0
- oca_odoo_pre_commit_hooks-0.2.29/tests/test_scss_css_import.py +93 -0
- oca_odoo_pre_commit_hooks-0.2.29/tests/test_scss_font_display.py +73 -0
- oca_odoo_pre_commit_hooks-0.2.27/src/oca_pre_commit_hooks/__init__.py +0 -1
- oca_odoo_pre_commit_hooks-0.2.27/tests/test_node_xml.py +0 -135
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/LICENSE +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/pyproject.toml +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/requirements.txt +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/setup.cfg +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_odoo_pre_commit_hooks.egg-info/dependency_links.txt +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_odoo_pre_commit_hooks.egg-info/entry_points.txt +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_odoo_pre_commit_hooks.egg-info/not-zip-safe +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_odoo_pre_commit_hooks.egg-info/requires.txt +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_odoo_pre_commit_hooks.egg-info/top_level.txt +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/__main__.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/base_checker.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/checks_odoo_module_csv.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/checks_odoo_module_fixit.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/checks_odoo_module_fixit_common.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/checks_odoo_module_fixit_rules/__init__.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/checks_odoo_module_fixit_rules/field_string_redundant.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/checks_odoo_module_fixit_rules/manifest_superfluous_key_rule.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/checks_odoo_module_fixit_rules/prefer_env_translation.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/checks_odoo_module_fixit_rules/unused_logger.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/checks_odoo_module_po.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/cli.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/cli_fixit.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/cli_po.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/global_parser.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/node_xml.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/src/oca_pre_commit_hooks/utils.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/tests/test_checks_po.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/tests/test_fixit.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/tests/test_fixit_flags.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/tests/test_pre_commit_hook.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/tests/test_profiling.py +0 -0
- {oca_odoo_pre_commit_hooks-0.2.27 → oca_odoo_pre_commit_hooks-0.2.29}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: oca-odoo-pre-commit-hooks
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.29
|
|
4
4
|
Summary: odoo-pre-commit-hooks to use in pre-commit-config.yml files
|
|
5
5
|
Home-page: https://github.com/OCA/odoo-pre-commit-hooks
|
|
6
6
|
Author: Odoo Community Association (OCA)
|
|
@@ -52,7 +52,7 @@ Dynamic: summary
|
|
|
52
52
|
[](https://pypi.org/project/oca-odoo-pre-commit-hooks)
|
|
53
53
|
[](https://pypi.org/project/oca-odoo-pre-commit-hooks)
|
|
54
54
|
[](https://pypi.org/project/oca-odoo-pre-commit-hooks)
|
|
55
|
-
[](https://github.com/OCA/odoo-pre-commit-hooks/compare/v0.2.29...main)
|
|
56
56
|
[](https://github.com/psf/black)
|
|
57
57
|
|
|
58
58
|
[//]: # (end-badges)
|
|
@@ -81,7 +81,7 @@ Add to your ".pre-commit-config.yaml" configuration file the following input
|
|
|
81
81
|
|
|
82
82
|
```yaml
|
|
83
83
|
- repo: https://github.com/OCA/odoo-pre-commit-hooks
|
|
84
|
-
rev: v0.2.
|
|
84
|
+
rev: v0.2.29
|
|
85
85
|
hooks:
|
|
86
86
|
- id: oca-checks-odoo-module
|
|
87
87
|
- id: oca-checks-po
|
|
@@ -199,6 +199,77 @@ duplicate CSV "id" AKA xmlid but for CSV files
|
|
|
199
199
|
* Check csv-syntax-error
|
|
200
200
|
Check syntax error for CSV files declared in the manifest
|
|
201
201
|
|
|
202
|
+
* Check scss-css-import
|
|
203
|
+
|
|
204
|
+
An `@import` of a stylesheet that is not part of the bundle: `@import url(...)`, an
|
|
205
|
+
`@import` of an `http(s)://` or `//` address, or of a `.css` file. (Any other `@import`
|
|
206
|
+
is a Sass partial that the compiler inlines, it costs nothing and is not reported.)
|
|
207
|
+
|
|
208
|
+
`@import url(...)` (and any `@import` inside a `.css` file) is left to the browser. The
|
|
209
|
+
browser does not know about the imported file until it has downloaded and parsed the one
|
|
210
|
+
that imports it, so the two downloads are chained one after the other instead of running
|
|
211
|
+
in parallel, and the page cannot paint before both end (GTmetrix: "Avoid CSS @import"
|
|
212
|
+
and "Avoid chaining critical requests"). When the address is another site, as
|
|
213
|
+
`fonts.googleapis.com`, it also costs a new connection (DNS, TCP and TLS), the
|
|
214
|
+
stylesheet has a short cache lifetime that you do not control, and every visitor is
|
|
215
|
+
revealed to a third party. Self-host instead: download the font files as `.woff2`,
|
|
216
|
+
declare the `@font-face` in the module with `font-display: swap` and delete the `@import`.
|
|
217
|
+
|
|
218
|
+
A quoted `@import "..."` of a `.css` file or of an address, in a `.scss` file, never
|
|
219
|
+
reaches the browser: Odoo removes the quoted imports whose path has a dot or starts with
|
|
220
|
+
`.`, `/` or `~`, and reports "Local import is forbidden for security reasons" among the
|
|
221
|
+
errors of the bundle. The file is not loaded at all. List it in the `assets` of the
|
|
222
|
+
manifest instead (`.css` files go in the bundle as they are), or self-host the font as
|
|
223
|
+
said above.
|
|
224
|
+
|
|
225
|
+
* Check scss-font-display-missing
|
|
226
|
+
|
|
227
|
+
A `@font-face` without `font-display`. The browser then uses `auto`, which in practice
|
|
228
|
+
is `block`: the text that uses the font stays invisible until the font arrives, up to
|
|
229
|
+
3 seconds, before it falls back (the "flash of invisible text"). That delays the First
|
|
230
|
+
and Largest Contentful Paint of every page that has text in that font (GTmetrix:
|
|
231
|
+
"Ensure text remains visible during webfont load").
|
|
232
|
+
|
|
233
|
+
`font-display: swap` paints the text at once with the fallback font and swaps it when the
|
|
234
|
+
font is ready. Prefer `optional` for a decorative font that may be skipped on a slow
|
|
235
|
+
connection, because it never moves the text (no layout shift). An icon font needs `block`:
|
|
236
|
+
while it downloads the browser must wait for it, because a fallback font paints the code
|
|
237
|
+
points of the icons as unrelated characters.
|
|
238
|
+
|
|
239
|
+
The stylesheets of the PDF report bundles are not reported: wkhtmltopdf does not paint the
|
|
240
|
+
text progressively, so `font-display` has no effect there.
|
|
241
|
+
|
|
242
|
+
The autofix adds `font-display: swap;` as the last declaration of the `@font-face`.
|
|
243
|
+
|
|
244
|
+
* Check scss-font-legacy-format
|
|
245
|
+
|
|
246
|
+
A `@font-face` serves its font as `.otf`, `.ttf`, `.eot` or `.woff` and no `.woff2`.
|
|
247
|
+
WOFF2 compresses the font with Brotli: the same font weighs about 50-70 % less than
|
|
248
|
+
the `.ttf`/`.otf` (an uncompressed container made for the desktop) and about 20-30 % less
|
|
249
|
+
than `.woff` (zlib). Every browser still supported reads it (Chrome 36, Firefox 39,
|
|
250
|
+
Safari 12, Edge 14), so no other format is needed as a fallback in a browser
|
|
251
|
+
(wkhtmltopdf does not read WOFF2, so the stylesheets of the report bundles are skipped).
|
|
252
|
+
With the default `font-display` the text stays invisible while the font downloads, so
|
|
253
|
+
its size shows in the First and Largest Contentful Paint
|
|
254
|
+
(GTmetrix: "Enormous network payloads").
|
|
255
|
+
|
|
256
|
+
To migrate a font keep its glyphs and convert only the container:
|
|
257
|
+
`pip install fonttools brotli && fonttools ttLib.woff2 compress Font.otf`
|
|
258
|
+
(or `woff2_compress Font.otf`), commit the new `.woff2`, point the `url()` to it with
|
|
259
|
+
`format("woff2")` and delete the old file. Convert `.eot` and `.svg` fonts from the
|
|
260
|
+
original `.ttf`/`.otf`.
|
|
261
|
+
|
|
262
|
+
Only the stylesheets that the manifest lists in `assets` are read: a Sass partial that is only
|
|
263
|
+
reached through an `@import`, a `.sass` or `.less` file is not.
|
|
264
|
+
The stylesheets of the PDF report bundles are not reported (the bundle is read from the
|
|
265
|
+
`assets` of the manifest: `web.report_assets_common`, `web.report_assets_pdf`,
|
|
266
|
+
`snailmail.report_assets_snailmail`...). wkhtmltopdf renders them with an old QtWebKit
|
|
267
|
+
that cannot read WOFF2, so their fonts must stay as `.ttf` or `.otf`.
|
|
268
|
+
|
|
269
|
+
The autofix rewrites the `url()` and its `format()` when the `.woff2` is already next
|
|
270
|
+
to the old file. It does not convert the font: the conversion is a binary file that
|
|
271
|
+
has to be reviewed and committed.
|
|
272
|
+
|
|
202
273
|
* Check xml-deprecated-data-node
|
|
203
274
|
Deprecated <data> node inside <odoo> xml node
|
|
204
275
|
|
|
@@ -236,6 +307,34 @@ Generated when the XML file is missing the XML declaration header '<?xml version
|
|
|
236
307
|
* Check xml-header-wrong
|
|
237
308
|
Generated when the XML file declaration header is different than expected (case sensitive).
|
|
238
309
|
|
|
310
|
+
* Check xml-img-without-size
|
|
311
|
+
|
|
312
|
+
The `<img>` tag of a QWeb template has no `width` and `height` attributes.
|
|
313
|
+
The browser reserves no space for the picture until it arrives, so everything below it
|
|
314
|
+
moves when it does (Cumulative Layout Shift, reported by Lighthouse and GTmetrix as
|
|
315
|
+
"Use explicit width and height on image elements").
|
|
316
|
+
Use the intrinsic size of the image in pixels: with `img-fluid` or `height: auto` the
|
|
317
|
+
picture still scales down with its container, but the `width` attribute is the width
|
|
318
|
+
that it uses, so a smaller number than the real one shrinks the picture.
|
|
319
|
+
The dynamic forms `t-att-width`, `t-attf-width`, `t-att` and `t-att-style`, a `width` and
|
|
320
|
+
a `height` in the inline `style` and an inline `aspect-ratio` are accepted too.
|
|
321
|
+
Images of a `t-field` or `t-out` widget, whose tag is built by Odoo, and the QWeb views
|
|
322
|
+
declared in the `arch` of an `ir.ui.view` record are not seen here.
|
|
323
|
+
|
|
324
|
+
The picture is not reported where stating its size is useless or harmful:
|
|
325
|
+
* a PDF report or a mail: the template inherits or calls a report or mail layout
|
|
326
|
+
(`web.external_layout*`, `web.html_container`, `mail.*`, `mass_mailing.*`), it is the
|
|
327
|
+
template of an `ir.actions.report` of the module, or its file is in a `report/` directory
|
|
328
|
+
or has `mail`, `mailing` or `digest` in its name
|
|
329
|
+
* content that the user replaces in the website builder: a picture with a fixed `src`
|
|
330
|
+
inside a `data-snippet`, an `oe_structure`/`o_editable` zone, a snippet template (`s_*`)
|
|
331
|
+
or a page template. A picture whose `src` is built by the template (`t-att-src`,
|
|
332
|
+
`t-attf-src`: the logo of the website, the photo of a record) is still reported
|
|
333
|
+
* a size already fixed by the class (`o_image_64_cover`) or by `width` and `height` in the
|
|
334
|
+
inline `style`, a picture out of the flow (`position-absolute`, `position: absolute`)
|
|
335
|
+
and a pixel inside `<noscript>`
|
|
336
|
+
Anything else can be silenced with the usual comment of the file.
|
|
337
|
+
|
|
239
338
|
* Check xml-not-valid-char-link
|
|
240
339
|
The resource in in src/href contains a not valid character.
|
|
241
340
|
|
|
@@ -266,6 +365,23 @@ if the record is integer but without eval attribute
|
|
|
266
365
|
instead of
|
|
267
366
|
`<field name="sequence" eval="100" />`
|
|
268
367
|
|
|
368
|
+
* Check xml-invisible-in-list-view
|
|
369
|
+
|
|
370
|
+
Using `invisible="1"` or `invisible="True"` on a `<field>` inside a `<list>` or `<tree>`
|
|
371
|
+
view does not hide the column properly. Since Odoo 17 the correct attribute to hide an
|
|
372
|
+
entire column is `column_invisible="True"`.
|
|
373
|
+
For more details see https://www.odoo.com/documentation/17.0/developer/reference/backend/views.html#lists
|
|
374
|
+
|
|
375
|
+
Only the columns, the fields that are direct children of the `<list>` or `<tree>`, are
|
|
376
|
+
checked, so the ones added by an inherited view (`<xpath ... position="inside">`,
|
|
377
|
+
`<attribute name="invisible">`) are not reported. A field of a view declared inside a
|
|
378
|
+
field of the list (`<form>`, `<kanban>`, ...) or of a `<groupby>` is not reported either.
|
|
379
|
+
|
|
380
|
+
The autofix replaces `invisible="1"` and `invisible="True"` with `column_invisible="True"`.
|
|
381
|
+
The column is then removed as a whole: its header, its footer total and its export
|
|
382
|
+
are gone too, instead of only emptying the cell of each row.
|
|
383
|
+
It is skipped (the error is still reported) when the field already has `column_invisible`.
|
|
384
|
+
|
|
269
385
|
* Check xml-create-user-wo-reset-password
|
|
270
386
|
records of user without `context="{'no_reset_password': True}"`
|
|
271
387
|
This context avoid send email and mail log warning
|
|
@@ -432,187 +548,216 @@ options:
|
|
|
432
548
|
|
|
433
549
|
* csv-duplicate-record-id
|
|
434
550
|
|
|
435
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
551
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/ir.model.access.csv#L5 Duplicate CSV record `access_account_account_type` broken_module/ir.model.access.csv:6
|
|
436
552
|
|
|
437
553
|
* csv-syntax-error
|
|
438
554
|
|
|
439
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
555
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/syntax_err_module/ir.model.access.csv#L1 'utf-8' codec can't decode byte 0xf1 in position 47: invalid continuation byte
|
|
440
556
|
|
|
441
557
|
* field-string-redundant
|
|
442
558
|
|
|
443
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
444
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
445
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
559
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/models/broken_model.py#L98 The 'string' attribute is redundant and should be removed. (has autofix) You can disable this check by adding the following comment to the affected line or just above it `# lint-ignore=field-string-redundant` or `# lint-ignore`
|
|
560
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/models/broken_model.py#L130 The 'string' attribute is redundant and should be removed. (has autofix) You can disable this check by adding the following comment to the affected line or just above it `# lint-ignore=field-string-redundant` or `# lint-ignore`
|
|
561
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/models/broken_model.py#L140 The 'string' attribute is redundant and should be removed. (has autofix) You can disable this check by adding the following comment to the affected line or just above it `# lint-ignore=field-string-redundant` or `# lint-ignore`
|
|
446
562
|
|
|
447
563
|
* file-not-used
|
|
448
564
|
|
|
449
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
565
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/__openerp__.py#L1 File "broken_module/report/test_report.xml" is not referenced in the manifest. 🔴 If it is loaded from another source (e.g. a post_init_hook script), just add it under the section "oca_data_manual": ["report/test_report.xml",] to be considered. 🔵 Otherwise, you might want to remove it.
|
|
450
566
|
|
|
451
567
|
* manifest-superfluous-key
|
|
452
568
|
|
|
453
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
454
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
455
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
569
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/__openerp__.py#L32 Delete empty values. You can disable this check by adding the following comment to the affected line or just above it `# lint-ignore=manifest-superfluous-key` or `# lint-ignore`
|
|
570
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/__openerp__.py#L34 Delete empty values. You can disable this check by adding the following comment to the affected line or just above it `# lint-ignore=manifest-superfluous-key` or `# lint-ignore`
|
|
571
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/woversion_module/__manifest__.py#L8 Delete empty values. You can disable this check by adding the following comment to the affected line or just above it `# lint-ignore=manifest-superfluous-key` or `# lint-ignore`
|
|
456
572
|
|
|
457
573
|
* manifest-syntax-error
|
|
458
574
|
|
|
459
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
460
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
575
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/manifest_werror/__manifest__.py#L1 Manifest could not be loaded manifest malformed
|
|
576
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/woinit_module/__manifest__.py#L1 Manifest could not be loaded
|
|
461
577
|
|
|
462
578
|
* prefer-env-translation
|
|
463
579
|
|
|
464
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
465
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
466
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
580
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/models/broken_model.py#L247 Use self.env._(...) instead of _(…) directly inside Odoo model methods. You can disable this check by adding the following comment to the affected line or just above it `# lint-ignore=prefer-env-translation` or `# lint-ignore`
|
|
581
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/models/broken_model.py#L264 Use self.env._(...) instead of _(…) directly inside Odoo model methods. You can disable this check by adding the following comment to the affected line or just above it `# lint-ignore=prefer-env-translation` or `# lint-ignore`
|
|
582
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/models/broken_model.py#L267 Use self.env._(...) instead of _(…) directly inside Odoo model methods. You can disable this check by adding the following comment to the affected line or just above it `# lint-ignore=prefer-env-translation` or `# lint-ignore`
|
|
467
583
|
|
|
468
584
|
* prefer-readme-rst
|
|
469
585
|
|
|
470
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
586
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/README.md#L1 Prefer README.rst instead of README.md
|
|
587
|
+
|
|
588
|
+
* scss-css-import
|
|
589
|
+
|
|
590
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/static/src/scss/imports.scss#L2 CSS `@import` of `url('https://fonts.googleapis.com/css?family=Barlow:300,400,700&display=swap')` is resolved by the browser The imported file is only discovered after the importing one is downloaded, so both downloads are chained. Self-host the font as .woff2 with an @font-face or list the stylesheet in the `assets` of the manifest
|
|
591
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/static/src/scss/imports.scss#L4 `@import` of `"//fonts.example.com/css/family.css"` is dropped by Odoo and never loaded Odoo removes the quoted @import whose path has a dot or starts with . / ~ ("Local import is forbidden"). List the file in the `assets` of the manifest or self-host the font as .woff2 with an @font-face
|
|
592
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/static/src/scss/imports.scss#L6 `@import` of `"legacy.css"` is dropped by Odoo and never loaded Odoo removes the quoted @import whose path has a dot or starts with . / ~ ("Local import is forbidden"). List the file in the `assets` of the manifest or self-host the font as .woff2 with an @font-face
|
|
593
|
+
|
|
594
|
+
* scss-font-display-missing
|
|
595
|
+
|
|
596
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/static/src/scss/fonts.scss#L2 `@font-face` without `font-display` Without it the text stays invisible while the font downloads. Add `font-display: swap;` (`optional` for a decorative font, `block` for an icon font)
|
|
597
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/static/src/scss/fonts.scss#L8 `@font-face` without `font-display` Without it the text stays invisible while the font downloads. Add `font-display: swap;` (`optional` for a decorative font, `block` for an icon font)
|
|
598
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/static/src/scss/fonts.scss#L14 `@font-face` without `font-display` Without it the text stays invisible while the font downloads. Add `font-display: swap;` (`optional` for a decorative font, `block` for an icon font)
|
|
599
|
+
|
|
600
|
+
* scss-font-legacy-format
|
|
601
|
+
|
|
602
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/static/src/scss/fonts.scss#L4 `@font-face` serves its font as .otf and not as `.woff2` WOFF2 (Brotli) weighs about 50-70 % less than .ttf/.otf and 20-30 % less than .woff, and every supported browser reads it. Convert: `fonttools ttLib.woff2 compress Font.otf` (pip install fonttools brotli), then use `url("Font.woff2") format("woff2")` and delete the old file
|
|
603
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/static/src/scss/fonts.scss#L10 `@font-face` serves its font as .ttf and not as `.woff2` WOFF2 (Brotli) weighs about 50-70 % less than .ttf/.otf and 20-30 % less than .woff, and every supported browser reads it. Convert: `fonttools ttLib.woff2 compress Font.otf` (pip install fonttools brotli), then use `url("Font.woff2") format("woff2")` and delete the old file
|
|
471
604
|
|
|
472
605
|
* unused-logger
|
|
473
606
|
|
|
474
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
607
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/models/model_inhe1.py#L17 Unused `_logger` is not allowed in Odoo models. Remove it if not used. You can disable this check by adding the following comment to the affected line or just above it `# lint-ignore=unused-logger` or `# lint-ignore`
|
|
475
608
|
|
|
476
609
|
* use-header-comments
|
|
477
610
|
|
|
478
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
611
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/eleven_module/models.py#L9 Use of header comments in lines 3, 5, 6, 7, 9
|
|
479
612
|
|
|
480
613
|
* weblate-component-too-long
|
|
481
614
|
|
|
482
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
615
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/syntax_err_module/__manifest__.py#L1 Repo Name + Odoo version + Module name is too long for weblate component 'big-big-big-big-big-big-big-big-big-big-big-big-big-big-big-big-big--00.0-syntax_err_module' size 91 is longer than 90 characters
|
|
483
616
|
|
|
484
617
|
* xml-create-user-wo-reset-password
|
|
485
618
|
|
|
486
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
619
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/test_module/res_users.xml#L10 record res.users without `context="{'no_reset_password': True}"`
|
|
487
620
|
|
|
488
621
|
* xml-dangerous-qweb-replace-low-priority
|
|
489
622
|
|
|
490
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
491
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
492
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
623
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/template1.xml#L4 Dangerous use of `replace` from view with priority 0 < 99 Only replace as a last resort. Try `position="attributes"`, `position="move"` or `t-if="False"` first
|
|
624
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/template1.xml#L7 Dangerous use of `replace` from view with priority 0 < 99 Only replace as a last resort. Try `position="attributes"`, `position="move"` or `t-if="False"` first
|
|
625
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/template1.xml#L18 Dangerous use of `replace` from view with priority 0 < 99 Only replace as a last resort. Try `position="attributes"`, `position="move"` or `t-if="False"` first
|
|
493
626
|
|
|
494
627
|
* xml-deprecated-data-node
|
|
495
628
|
|
|
496
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
497
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
498
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
629
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/demo/duplicated_id_demo.xml#L3 Deprecated `<data>` node Use `<odoo>` instead of `<odoo><data>` or `<odoo noupdate="1">` instead of `<odoo><data noupdate="1">`
|
|
630
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view.xml#L3 Deprecated `<data>` node Use `<odoo>` instead of `<odoo><data>` or `<odoo noupdate="1">` instead of `<odoo><data noupdate="1">`
|
|
631
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view2.xml#L3 Deprecated `<data>` node Use `<odoo>` instead of `<odoo><data>` or `<odoo noupdate="1">` instead of `<odoo><data noupdate="1">`
|
|
499
632
|
|
|
500
633
|
* xml-deprecated-oe-chatter
|
|
501
634
|
|
|
502
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
635
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/views/deprecated_chatter.xml#L6 Please replace old style chatters with the new tag <chatter/>.
|
|
503
636
|
|
|
504
637
|
* xml-deprecated-openerp-node
|
|
505
638
|
|
|
506
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
507
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
508
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
639
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view.xml#L2 Deprecated `<openerp>` xml node Use `<odoo>` instead
|
|
640
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view2.xml#L2 Deprecated `<openerp>` xml node Use `<odoo>` instead
|
|
641
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/test_module/model_view.xml#L2 Deprecated `<openerp>` xml node Use `<odoo>` instead
|
|
509
642
|
|
|
510
643
|
* xml-deprecated-qweb-directive
|
|
511
644
|
|
|
512
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
513
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
645
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/test_module/website_templates.xml#L7 Deprecated QWeb directive `t-esc-options`. Use `t-options` instead
|
|
646
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/test_module/website_templates.xml#L26 Deprecated QWeb directive `t-field-options`. Use `t-options` instead
|
|
514
647
|
|
|
515
648
|
* xml-deprecated-qweb-directive-15
|
|
516
649
|
|
|
517
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
518
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
519
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
650
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/views/deprecated_qweb_directives15.xml#L6 Deprecated QWeb directive `t-esc`. Use `t-out` instead
|
|
651
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/views/deprecated_qweb_directives15.xml#L7 Deprecated QWeb directive `t-raw`. Use `t-out` instead
|
|
652
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/views/deprecated_qweb_directives15.xml#L15 Deprecated QWeb directive `t-esc`. Use `t-out` instead
|
|
520
653
|
|
|
521
654
|
* xml-deprecated-res-groups-category-id
|
|
522
655
|
|
|
523
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
524
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
525
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
656
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo19_module/security/res_groups.xml#L6 Deprecated `<field name="category_id"` of `res.groups` removed in Odoo 19.0 Use `<field name="privilege_id" ref="..."` with a `res.groups.privilege` record instead
|
|
657
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo19_module/security/res_groups.xml#L12 Deprecated `<field name="category_id"` of `res.groups` removed in Odoo 19.0 Use `<field name="privilege_id" ref="..."` with a `res.groups.privilege` record instead
|
|
658
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo19_module/security/res_groups.xml#L15 Deprecated `<field name="category_id"` of `res.groups` removed in Odoo 19.0 Use `<field name="privilege_id" ref="..."` with a `res.groups.privilege` record instead
|
|
526
659
|
|
|
527
660
|
* xml-deprecated-tree-attribute
|
|
528
661
|
|
|
529
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
530
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
531
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
662
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view_odoo.xml#L31 Deprecated "<tree string=..."
|
|
663
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view_odoo.xml#L42 Deprecated "<tree colors=..."
|
|
664
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view_odoo.xml#L53 Deprecated "<tree fonts=..."
|
|
532
665
|
|
|
533
666
|
* xml-duplicate-fields
|
|
534
667
|
|
|
535
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
536
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
537
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
668
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view_odoo2.xml#L5 Duplicate xml field `name` broken_module/model_view_odoo2.xml:12
|
|
669
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view_odoo2.xml#L22 Duplicate xml field `model` broken_module/model_view_odoo2.xml:23
|
|
670
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view_odoo2.xml#L80 Duplicate xml field `arch` broken_module/model_view_odoo2.xml:83
|
|
538
671
|
|
|
539
672
|
* xml-duplicate-record-id
|
|
540
673
|
|
|
541
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
542
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
674
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view.xml#L5 Duplicate xml record id `view_model_form` broken_module/model_view_odoo.xml:5 broken_module/model_view_odoo2.xml:4
|
|
675
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view2.xml#L5 Duplicate xml record id `view_model_form2` broken_module/model_view_odoo2.xml:16
|
|
543
676
|
|
|
544
677
|
* xml-duplicate-template-id
|
|
545
678
|
|
|
546
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
547
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
548
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
679
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/template1.xml#L3 Duplicate xml template id `qweb/my_template1_noupdate_0` broken_module/template1_copy2.xml:3
|
|
680
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/template1.xml#L10 Duplicate xml template id `qweb/my_template2_noupdate_0` broken_module/template1_copy2.xml:10
|
|
681
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/template1.xml#L17 Duplicate xml template id `qweb/my_template3_noupdate_0` broken_module/template1_copy2.xml:17
|
|
549
682
|
|
|
550
683
|
* xml-field-bool-without-eval
|
|
551
684
|
|
|
552
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
553
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
685
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/demo/duplicated_id_demo.xml#L18 Field `active` with boolean value without `eval` attribute
|
|
686
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view_odoo2.xml#L18 Field `active` with boolean value without `eval` attribute
|
|
554
687
|
|
|
555
688
|
* xml-field-numeric-without-eval
|
|
556
689
|
|
|
557
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
558
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
559
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
690
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/demo/duplicated_id_demo.xml#L8 Field `priority` with numeric value without `eval` attribute
|
|
691
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/demo/duplicated_id_demo.xml#L22 Field `sequence` with numeric value without `eval` attribute
|
|
692
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view2.xml#L62 Field `priority` with numeric value without `eval` attribute
|
|
560
693
|
|
|
561
694
|
* xml-header-missing
|
|
562
695
|
|
|
563
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
564
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
696
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view_odoo2.xml#L1 XML missing header
|
|
697
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/xml_wo_header.xml#L1 XML missing header
|
|
565
698
|
|
|
566
699
|
* xml-header-wrong
|
|
567
700
|
|
|
568
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
569
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
570
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
701
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/demo/duplicated_id_demo.xml#L1 XML header expected '<?xml version="1.0" encoding="UTF-8" ?>' but received '<?xml version="1.0" encoding="utf-8"?>'
|
|
702
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/deprecated_disable.xml#L1 XML header expected '<?xml version="1.0" encoding="UTF-8" ?>' but received '<?xml version="1.0" encoding="utf-8" ?>'
|
|
703
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view.xml#L1 XML header expected '<?xml version="1.0" encoding="UTF-8" ?>' but received '<?xml version="1.0" encoding="utf-8"?>'
|
|
704
|
+
|
|
705
|
+
* xml-img-without-size
|
|
706
|
+
|
|
707
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/views/img_without_size.xml#L6 `<img>` without explicit width and height Set `width` and `height` to the intrinsic size of the image in pixels (`img-fluid` still scales it down) to avoid layout shifts while the image loads
|
|
708
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/views/img_without_size.xml#L8 `<img>` without explicit height Set `width` and `height` to the intrinsic size of the image in pixels (`img-fluid` still scales it down) to avoid layout shifts while the image loads
|
|
709
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/views/img_without_size.xml#L59 `<img>` without explicit width and height Set `width` and `height` to the intrinsic size of the image in pixels (`img-fluid` still scales it down) to avoid layout shifts while the image loads
|
|
710
|
+
|
|
711
|
+
* xml-invisible-in-list-view
|
|
712
|
+
|
|
713
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo18_module/views/invisible_in_list.xml#L11 Use `column_invisible="True"` instead of `invisible` for field `state` inside a list/tree view `invisible` in a list hides the cell per-row; `column_invisible` hides the whole column
|
|
714
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo19_module/views/invisible_in_list.xml#L11 Use `column_invisible="True"` instead of `invisible` for field `state` inside a list/tree view `invisible` in a list hides the cell per-row; `column_invisible` hides the whole column
|
|
715
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/odoo19_module/views/invisible_in_list.xml#L23 Use `column_invisible="True"` instead of `invisible` for field `active` inside a list/tree view `invisible` in a list hides the cell per-row; `column_invisible` hides the whole column
|
|
571
716
|
|
|
572
717
|
* xml-not-valid-char-link
|
|
573
718
|
|
|
574
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
575
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
719
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/test_module/website_templates.xml#L48 The resource in in src/href contains a not valid character
|
|
720
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/test_module/website_templates.xml#L50 The resource in in src/href contains a not valid character
|
|
576
721
|
|
|
577
722
|
* xml-oe-structure-missing-id
|
|
578
723
|
|
|
579
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
580
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
581
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
724
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/test_module/website_templates.xml#L9 Consider removing the class `oe_structure` or adding a proper id to the tag. The id must contain `oe_structure`
|
|
725
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/test_module/website_templates.xml#L13 Consider removing the class `oe_structure` or adding a proper id to the tag. The id must contain `oe_structure`
|
|
726
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/test_module/website_templates.xml#L30 Consider removing the class `oe_structure` or adding a proper id to the tag. The id must contain `oe_structure`
|
|
582
727
|
|
|
583
728
|
* xml-record-missing-id
|
|
584
729
|
|
|
585
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
586
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
730
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view.xml#L25 Record has no id, add a unique one to create a new record, use an existing one to update it
|
|
731
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view.xml#L28 Record has no id, add a unique one to create a new record, use an existing one to update it
|
|
587
732
|
|
|
588
733
|
* xml-redundant-module-name
|
|
589
734
|
|
|
590
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
591
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
592
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
735
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view2.xml#L15 Redundant module name `<record id="broken_module.view_model_form2"` Use `<record id="view_model_form2"` instead
|
|
736
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view_odoo2.xml#L158 Redundant module name `<menuitem id="broken_module.menu_root"` Use `<menuitem id="menu_root"` instead
|
|
737
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view_odoo2.xml#L165 Redundant module name `<menuitem id="broken_module.menu_root2"` Use `<menuitem id="menu_root2"` instead
|
|
593
738
|
|
|
594
739
|
* xml-syntax-error
|
|
595
740
|
|
|
596
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
597
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
741
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/file_no_exist.xml#L1 [Errno 2] No such file or directory: ''
|
|
742
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/file_no_exist.xml#L1 [Errno 2] No such file or directory: ''
|
|
598
743
|
|
|
599
744
|
* xml-tag-position
|
|
600
745
|
|
|
601
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
602
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
603
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
746
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/deprecated_disable.xml#L4 The expected attributes order is `<record id="duplicate_record" ...>` Use `<record id="duplicate_record" ...>` instead
|
|
747
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view_odoo2.xml#L43 The expected attributes order is `<record id="view_ir_config_search" ...>` Use `<record id="view_ir_config_search" ...>` instead
|
|
748
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view_odoo2.xml#L68 The expected attributes order is `<record id="access_rule" ...>` Use `<record id="access_rule" ...>` instead
|
|
604
749
|
|
|
605
750
|
* xml-view-dangerous-replace-low-priority
|
|
606
751
|
|
|
607
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
608
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
609
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
752
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view2.xml#L25 Dangerous use of `replace` from view with priority 0 < 99 Only replace as a last resort. Try `position="attributes"`, `position="move"` or `invisible="1"` first
|
|
753
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view2.xml#L37 Dangerous use of `replace` from view with priority 0 < 99 Only replace as a last resort. Try `position="attributes"`, `position="move"` or `invisible="1"` first
|
|
754
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view2.xml#L47 Dangerous use of `replace` from view with priority 0 < 99 Only replace as a last resort. Try `position="attributes"`, `position="move"` or `invisible="1"` first
|
|
610
755
|
|
|
611
756
|
* xml-xpath-translatable-item
|
|
612
757
|
|
|
613
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
614
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
615
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
758
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/model_view.xml#L11 Use of translatable xpath `text()`
|
|
759
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/template1.xml#L39 Use of translatable xpath `text()`
|
|
760
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/template1_copy.xml#L31 Use of translatable xpath `text()`
|
|
616
761
|
|
|
617
762
|
[//]: # (end-example)
|
|
618
763
|
|
|
@@ -624,49 +769,49 @@ options:
|
|
|
624
769
|
|
|
625
770
|
* po-duplicate-message-definition
|
|
626
771
|
|
|
627
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
628
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
629
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
772
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/es.po#L17 Duplicate PO message definition `Branch` in lines 23, 29. Odoo exports these items by msgid and delete one of them. Use the `i18n_extra` folder instead of `i18n` to ignore this message.
|
|
773
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/es.po#L35 Duplicate PO message definition `Message id toooooooooooooooooooooooooooo...` in lines 41. Odoo exports these items by msgid and delete one of them. Use the `i18n_extra` folder instead of `i18n` to ignore this message.
|
|
774
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/es.po#L65 Duplicate PO message definition `One variable {variable1}` in lines 71. Odoo exports these items by msgid and delete one of them. Use the `i18n_extra` folder instead of `i18n` to ignore this message.
|
|
630
775
|
|
|
631
776
|
* po-duplicate-model-definition
|
|
632
777
|
|
|
633
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
634
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
635
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
636
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
637
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
638
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
639
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
778
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/es.po#L17 Translation for model:ir.model.fields,field_description:broken_module.field_wizard_description has been defined more than once in line(s) 29
|
|
779
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/es.po#L35 Translation for model:ir.model.fields,field_description2:broken_module.field_wizard_description2 has been defined more than once in line(s) 41
|
|
780
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/es.po#L59 Translation for model:ir.model.fields,field_description5:broken_module.field_wizard_description5 has been defined more than once in line(s) 65
|
|
781
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/test_module/i18n/fr.po#L24 Translation for model:ir.model.fields,field_description2:test_module.field_description2 has been defined more than once in line(s) 24
|
|
782
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/test_module/i18n/fr.po#L31 Translation for model:ir.model.fields,field_description5:test_module.field_description5 has been defined more than once in line(s) 31
|
|
783
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/test_module/i18n/fr.po#L38 Translation for model:ir.model.fields,field_description3:test_module.field_description3 has been defined more than once in line(s) 38
|
|
784
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/test_module/i18n/fr.po#L45 Translation for model:ir.model.fields,field_description4:test_module.field_description4 has been defined more than once in line(s) 45
|
|
640
785
|
|
|
641
786
|
* po-pretty-format
|
|
642
787
|
|
|
643
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
644
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
645
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
646
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
647
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
648
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
788
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/ar_unicode.po Wrong formatting
|
|
789
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/broken_module.pot Wrong formatting
|
|
790
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/es.po Wrong formatting
|
|
791
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/xml_semi_empty.po Wrong formatting
|
|
792
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/eleven_module/i18n/ugly.po Wrong formatting
|
|
793
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/test_module/i18n/fr.po Wrong formatting
|
|
649
794
|
|
|
650
795
|
* po-python-parse-format
|
|
651
796
|
|
|
652
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
653
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
654
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
655
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
797
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/es.po#L53 Translation string couldn't be parsed correctly using str.format IndexError('Replacement index 1 out of range for positional args tuple')
|
|
798
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/es.po#L59 Translation string couldn't be parsed correctly using str.format IndexError('Replacement index 1 out of range for positional args tuple')
|
|
799
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/es.po#L65 Translation string couldn't be parsed correctly using str.format KeyError('variable2')
|
|
800
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/es.po#L71 Translation string couldn't be parsed correctly using str.format KeyError('variable2')
|
|
656
801
|
|
|
657
802
|
* po-python-parse-printf
|
|
658
803
|
|
|
659
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
660
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
804
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/es.po#L47 Translation string couldn't be parsed correctly using str%variables TypeError('not all arguments converted during string formatting')
|
|
805
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/es.po#L83 Translation string couldn't be parsed correctly using str%variables TypeError('%d format: a real number is required, not str')
|
|
661
806
|
|
|
662
807
|
* po-requires-module
|
|
663
808
|
|
|
664
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
809
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module/i18n/broken_module.pot#L14 Translation entry requires comment `#. module: MODULE`
|
|
665
810
|
|
|
666
811
|
* po-syntax-error
|
|
667
812
|
|
|
668
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
669
|
-
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.
|
|
813
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/broken_module2/i18n/en.po#L1 Syntax error in po file
|
|
814
|
+
- https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.29/test_repo/syntax_err_module/i18n/es.po#L19 Syntax error in po file
|
|
670
815
|
|
|
671
816
|
[//]: # (end-example-po)
|
|
672
817
|
|
|
@@ -682,6 +827,19 @@ and promote its widespread use.
|
|
|
682
827
|
CHANGES
|
|
683
828
|
=======
|
|
684
829
|
|
|
830
|
+
v0.2.29
|
|
831
|
+
-------
|
|
832
|
+
|
|
833
|
+
* [ADD] checks\_odoo\_module\_scss: new scss-css-import check
|
|
834
|
+
* [ADD] checks\_odoo\_module\_scss: new scss-font-display-missing check with autofix
|
|
835
|
+
* [ADD] checks\_odoo\_module\_scss: new scss-font-legacy-format check with autofix (#205)
|
|
836
|
+
* [ADD] checks\_odoo\_module\_xml: new xml-img-without-size check (#204)
|
|
837
|
+
|
|
838
|
+
v0.2.28
|
|
839
|
+
-------
|
|
840
|
+
|
|
841
|
+
* [ADD] checks\_odoo\_module\_xml: new xml-invisible-in-list-view check with autofix for v17+ (#203)
|
|
842
|
+
|
|
685
843
|
v0.2.27
|
|
686
844
|
-------
|
|
687
845
|
|