Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Filter out "bump version" from CHANGELOG #472

Merged
merged 2 commits into from
Oct 3, 2023

Conversation

antonag32
Copy link
Contributor

Commits which bump versions will no longer be displayed on the auto generated CHANGELOG.

Closes #471.

@antonag32
Copy link
Contributor Author

Can be tested with python setup.py --long-description (at least that is how I did it).

@moylop260
Copy link
Collaborator

Could you share the output, please?

@antonag32
Copy link
Contributor Author

antonag32 commented Oct 2, 2023

Here it is:

[//]: # (start-badges)

[![Build Status](https://github.com/OCA/pylint-odoo/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/OCA/pylint-odoo/actions/workflows/test.yml?query=branch%3Amain)
[![codecov](https://codecov.io/gh/OCA/pylint-odoo/branch/main/graph/badge.svg)](https://codecov.io/gh/OCA/pylint-odoo)
[![code-style-black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![version](https://img.shields.io/pypi/v/pylint-odoo.svg)](https://pypi.org/project/pylint-odoo)
[![pypi-downloads-monthly](https://img.shields.io/pypi/dm/pylint-odoo.svg?style=flat)](https://pypi.python.org/pypi/pylint-odoo)
[![supported-versions](https://img.shields.io/pypi/pyversions/pylint-odoo.svg)](https://pypi.org/project/pylint-odoo)
[![wheel](https://img.shields.io/pypi/wheel/pylint-odoo.svg)](https://pypi.org/project/pylint-odoo)
[![commits-since](https://img.shields.io/github/commits-since/OCA/pylint-odoo/v8.0.21.svg)](https://github.com/OCA/pylint-odoo/compare/v8.0.21...main)

[//]: # (end-badges)


# Pylint Odoo plugin

Enable custom checks for Odoo modules.

[//]: # (start-checks)

Short Name | Description | Code
--- | --- | ---
attribute-deprecated | attribute "%s" deprecated | W8105
attribute-string-redundant | The attribute string is redundant. String parameter equal to name of variable | W8113
bad-builtin-groupby | Used builtin function `itertools.groupby`. Prefer `odoo.tools.groupby` instead. More info about https://github.com/odoo/odoo/issues/105376 | W8155
consider-merging-classes-inherited | Consider merging classes inherited to "%s" from %s. | R8180
context-overridden | Context overridden using dict. Better using kwargs `with_context(**%s)` or `with_context(key=value)` | W8121
deprecated-odoo-model-method | %s has been deprecated by Odoo. Please look for alternatives. | W8160
development-status-allowed | Manifest key development_status "%s" not allowed. Use one of: %s. | C8111
except-pass | pass into block except. If you really need to use the pass consider logging that exception | W8138
external-request-timeout | Use of external request method `%s` without timeout. It could wait for a long time | E8106
invalid-commit | Use of cr.commit() directly - More info https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#never-commit-the-transaction | E8102
license-allowed | License "%s" not allowed in manifest file. | C8105
manifest-author-string | The author key in the manifest file must be a string (with comma separated values) | E8101
manifest-data-duplicated | The file "%s" is duplicated in lines %s from manifest key "%s" | W8125
manifest-deprecated-key | Deprecated key "%s" in manifest file | C8103
manifest-maintainers-list | The maintainers key in the manifest file must be a list of strings | E8104
manifest-required-author | One of the following authors must be present in manifest: %s | C8101
manifest-required-key | Missing required key "%s" in manifest file | C8102
manifest-version-format | Wrong Version Format "%s" in manifest file. Regex to match: "%s" | C8106
method-compute | Name of compute method should start with "_compute_" | C8108
method-inverse | Name of inverse method should start with "_inverse_" | C8110
method-required-super | Missing `super` call in "%s" method. | W8106
method-search | Name of search method should start with "_search_" | C8109
missing-readme | Missing ./README.rst file. Template here: %s | C8112
missing-return | Missing `return` (`super` is used) in method %s. | W8110
no-raise-unlink | No exceptions should be raised inside unlink() functions | E8140
no-wizard-in-models | No wizard class for model directory. See the complete structure https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#complete-structure | C8113
no-write-in-compute | Compute method calling `write`. Use `update` instead. | E8135
odoo-addons-relative-import | Same Odoo module absolute import. You should use relative import with "." instead of "odoo.addons.%s" | W8150
odoo-exception-warning | `odoo.exceptions.Warning` is a deprecated alias to `odoo.exceptions.UserError` use `from odoo.exceptions import UserError` | R8101
print-used | Print used. Use `logger` instead. | W8116
renamed-field-parameter | Field parameter "%s" is no longer supported. Use "%s" instead. | W8111
resource-not-exist | File "%s": "%s" not found. | F8101
sql-injection | SQL injection risk. Use parameters if you can. - More info https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#no-sql-injection | E8103
test-folder-imported | Test folder imported in module %s | E8130
translation-contains-variable | Translatable term in "%s" contains variables. Use %s instead | W8115
translation-field | Translation method _("string") in fields is not necessary. | W8103
translation-format-interpolation | Use %s formatting in odoo._ functions | W8302
translation-format-truncated | Logging format string ends in middle of conversion specifier | E8301
translation-fstring-interpolation | Use %s formatting in odoo._ functions | W8303
translation-not-lazy | Use %s formatting in odoo._ functions | W8301
translation-positional-used | Translation method _(%s) is using positional string printf formatting. Use named placeholder `_("%%(placeholder)s")` instead. | W8120
translation-required | String parameter on "%s" requires translation. Use %s_(%s) | C8107
translation-too-few-args | Not enough arguments for odoo._ format string | E8306
translation-too-many-args | Too many arguments for odoo._ format string | E8305
translation-unsupported-format | Unsupported odoo._ format character %r (%#02x) at index %d | E8300
use-vim-comment | Use of vim comment | W8202
website-manifest-key-not-valid-uri | Website "%s" in manifest key is not a valid URI | W8114


[//]: # (end-checks)


# Install

You do not need to install manually if you use pre-commit-config

But if you even need to install it

    pip install pylint-odoo

# Usage pre-commit-config.yaml

Add to your ".pre-commit-config.yaml" configuration file the following input


```yaml
    - repo: https://github.com/OCA/pylint-odoo
        rev: v8.0.21 # may be a tag or commit hash
        hooks:
        # Add to your .pylintrc file:
        # [MASTER]
        # load-plugins=pylint_odoo
        - id: pylint_odoo

Usage

pylint --load-plugins=pylint_odoo -e odoolint path/to/test

or use configuration file you can generate the OCA one using the following template repository:

https://github.com/OCA/oca-addons-repo-template

Then running

pylint --rcfile=.pylintrc path/to/test

Example to test only pylint_odoo checks:

pylint --load-plugins=pylint_odoo -d all -e odoolint {ADDONS-PATH}/*

There are checks only valid for a particular Odoo version
To know what version of odoo are you running pylint needs the parameter

pylint --load-plugins=pylint_odoo --valid-odoo-versions={YOUR_ODOO_VERSION}

with particular odoo version e.g. "16.0"

Checks valid only for odoo >= 14.0

translation-format-interpolation
translation-format-truncated
translation-fstring-interpolation
translation-not-lazy
translation-too-few-args
translation-too-many-args
translation-unsupported-format

Checks valid only for odoo <= 13.0

translation-contains-variable

Examples

Development

To run all the tests run:

tox

Use extra parameters to change the test behaviour

e.g. particular python version

tox -e py310

e.g. particular unittest method

tox -e py310 -- -k test_20_expected_errors

e.g. all the tests at the same time in parallel

tox -p auto

Licenses

This repository is licensed under AGPL-3.0.


OCA, or the Odoo Community Association, is a nonprofit
organization whose mission is to support the collaborative development of Odoo features
and promote its widespread use.

CHANGES

v8.0.0

7.0.4

7.0.3

  • [REF] README: Auto-update Using pylint_odoo.messages2rst()
  • [REF] CI: Comment py3.7 travis with weird error unrelated
  • [ADD] manifest-data-duplicated: Detect duplicated data file

7.0.2

7.0.1

7.0.0

6.2.0

6.1.0

6.0.0

5.0.5

5.0.4

5.0.3

5.0.2

5.0.1

5.0.0

4.0.0

3.10.0

3.9.0

3.8.0

3.7.1

3.7.0

3.6.0

3.5.1

3.5.0

3.4.0

  • [REF] README: Auto-update Using pylint_odoo.messages2rst()
  • Fixing pragma: no cover position
  • [ADD] po-msgstr-variables: Check if string translated can be parsed correctly
  • [ADD] duplicate-po-message-definition, po-syntax-error: Enable PO checks

3.3.2

3.3.1

  • [REF] missing-import-error: Add new packages for Odoo v13.0

3.3.0

3.2.0

  • [FIX] get_manifest_file: Get manifest file correctly
  • [FIX] Visit module: manage odoo subdirectories Better way to check whether a path is a path of a subdirectoy of a Odoo module. Before, '/a/b/cc/d' was considered as a subdirectoy of '/a/b/c' because '/a/b/c' in '/a/b/cc/d' == True

3.1.0

3.0.3

3.0.2

  • [REF] README: Auto-update Using pylint_odoo.messages2rst()
  • [REF] CI: Fixing flake8, tests and clean requirements
  • [REF] pylint_odoo: Supports odoo 13.0
  • [ADD] method-default prefix
  • [FIX] .travis.yml: Upgrade nvm version supported for eslint
  • Allow console statements
  • [ADD] print-used: Use _logger instead of print ([ADD] print-used: Use _logger instead of print #241)

3.0.1

  • [FIX] AttributeError: 'MessagesStore' object has no attribute '_messages' related to pylint-dev/pylint@75cecdb
  • [IMP] added support Pylint 2.3.0 and Astroid 2.2.0

3.0.0

2.0.2

  • [REF] manifest-required-authors: Support old deprecated parameter

2.0.1

2.0.0

1.9.5

  • [REF] .travis.yml: Just deploy a env and avoid cleanup before to deploy

1.9.4

1.9.3

1.8.2

  • [REF] pylint_odoo: Support python3

1.8.1

1.8.0

1.7.0

1.6.0

1.5.0

1.4.0

  • [REF] attribute-deprecated: Deprecate length class attribute ([REF] attribute-deprecated: Deprecate length class attribute #86)
  • [ADD] missing-return If you use call a `super` method then you will need return the original value. If you want overwrite a original method then you need add documentation of why and add a `pylint: disable=missing-return`
  • [FIX] Whitelist `anybox.testing.openerp` * Add `anybox.testing.openerp` - Fixes Whitelist "anybox.testing.openerp" dependency #81
  • [FIX] manifest-version-format: Fix regex to use explicit dot instead of any char
  • [FIX] manifest-version-format: Support -e manifest-version-format only
  • [FIX] missing-import-error: Updating libraries used from requirements.txt but not imported or nested imported from odoo
  • [IMP] manifest-version-format: Add valid_odoo_versions parameter to force a valid version of odoo in the manifest version
  • [REF] missing-import-error: Skip test file since these files are loaded only when running tests and in such a case your module and their external dependencies are installed
  • [ADD] Support for 10.0 manifest name
  • [REF] requirements: Update developer version of pylint and astroid

1.3.5

1.3.4

  • [REF] README: Update messages list

1.3.3

1.3.2

  • [REF] README: Update messages list

1.3.1

1.3.0

1.2.0

  • [REF] README.rst: Updating new checks
  • [IMP] test: Add tox for multi-environment and add compatiblity with latest version
  • [ADD] translation-required: Add check to required even a translation ([ADD] translation-required: Add check to required even a translation #23)
  • [IMP] Add pylint check missing newline in extra extension files
  • [IMP] test: Add tox for multi-environment and add compatiblity with latest version
  • [IMP] Add Check tabs identation instead of four spaces
  • better_msg
  • merge
  • [REF] test: better way to identify check error expected
  • [IMP] Add check Duplicate field in xml record ([IMP] Add check Duplicate field in xml record #20)
  • [IMP] Add pylint check Redundant module name reference in xml_id
  • [IMP] pylint_odoo: Add check duplicate ids in ir.model.access.csv files
  • [IMP] pylint_odoo: Add check for manifest-version-format
  • [FIX] OCA/MQT#302: Use of astroid version 1.3.8

1.1.0

  • [FIX] setup: Build ChangeLog file
  • [ADD] Add check 'deprecated-openerp-xml-node'
  • [ADD] ChangeLog: Empty file to support auto build
  • [FIX] Change _fields by _columns
  • [REF] Fix typo
  • [IMP] Add check 'create-user-without-reset-password'
  • [IMP] Support odoo tag in xml file
  • [REF] Support of 'noupdate' in check 'duplicate-xml-record-id'
  • [REF] setup.cfg: Enable ChangeLog
  • [REF] README: Add new message manifest-author-string

1.0.2

  • check that author is a string

1.0.1

  • [REF] Migrate md to rst

1.0.0

  • [IMP] .travis.yml: Enable auto deploy of pypi package from travis
  • [ADD] pylint_odoo: Add main package
  • [ADD] .gitignore: Add file gitignore for first commit

@antonag32
Copy link
Contributor Author

nvm I see mistakes, working on them

@antonag32 antonag32 changed the title [REF] Filter out "bump version" from CHANGELOG Draft: [REF] Filter out "bump version" from CHANGELOG Oct 2, 2023
Commits which bump versions will no longer be displayed on the auto
generated CHANGELOG.

Closes OCA#471.
@antonag32
Copy link
Contributor Author

Output looks better now (just an excerpt):

CHANGES
=======

* [REF] Filter out "bump version" from CHANGELOG

v8.0.21
-------

* [ADD] deprecated-odoo-model-method: New check to detect deprecated method for each Odoo version (#470)
* [REF] ci: run only one tox env per job (#468)

v8.0.20
-------

* [REF] tox: Build ChangeLog again (#466)
* [ADD] no-raise-unlink: Check if there is raise sentence in unlink method  (#458)
* [FIX] correct README pre-commit usage (#463)

v8.0.19
-------

* [FIX] pre-commit-vauxoo: Fix isort hook - RuntimeError The Poetry configuration is invalid (#456)

v8.0.18
-------

* [FIX] Readme: new CLI command format --valid-odoo-version (#453)
* [REF] ci: Update gh actions .yml and tox.ini (#451)
* [FIX] pre-commit-config: Update flake8 repo (#446)

v8.0.17
-------

* [REM] Remove unused eslintrc file
* [REF] tests: Autogenerate readme with examples from test\_repo
* [REF] tox, pre-commit, readme: Small changes (#443)

v8.0.16
-------

* [ADD] bad-builtin-groupby: Prefer \`odoo.tools.groupby\` instead (#442)

v8.0.15
-------

* [FIX] setup: Add missing "requirements.txt" file to package (#441)

v8.0.14
-------

* [REF] no-wizard-in-models: Add exception for "res.config\*" inherited classes (#439)
* [ADD] no-wizard-in-models: Add new check for avoid adding wizards class in models directory (#437)

v8.0.13
-------

* [REF] consider-merging-classes-inherited: Improve message with relpath + column number (#436)

v8.0.12
-------

* [FIX] consider-merging-classes-inherited: Fix TODO Consider case where \_inherit is assigned before to \_name (#435)
* [FIX] custom\_logging: Fix AstroidSyntaxError using only binop related to '%' (#434)

v8.0.11
-------

* [REF] manifest-data-duplicated, resource-not-exist: Improve line number (lineno) of the duplicated node (#433)

v8.0.10
-------

* [FIX] pylint\_odoo: Using node.op instead of hardcoded % (#432)

v8.0.9
------

* [FIX] pylint\_odoo: "ImportError: No module named 'packaging'" (#431)
* [REF] readme: Add monthly downloads from pypi badge (#430)
* [REF] pylint\_odoo: Using new typing astroid.nodes instead of astroid.Class (#429)

v8.0.8
------

* [ADD] no-write-in-compute: Don't write on a computed field  (#427)

v8.0.7
------

* [REF] pylint\_odoo: Replace options name from "\_" to "-" because (#426)

v8.0.6
------

* [REF] README: Auto update README (#425)
* [REF] pylint\_odoo: Process max\_odoo\_version and min\_odoo\_version for checks (#424)
* [ADD] translation-\*: Add translation-\* checks with the same "logging" checks but for "odoo.\_" translate method (#423)
* [REF] CI: Enable py3.11 (#420)

v8.0.5
------

* [REF] tox: Enable lints from environment list (#418)
* [REF] setup: Match requires-python = ">=3.7.2" from pylint (#417)
* [REF] CI: Enable tox with parallels + codecov compatibility (#415)
* [REF] augmentations: Use message code instead of message id for supression of codes (#414)

v8.0.4
------

* [REF] README: Auto-update Using pylint\_odoo.messages2md()
* [REM] class-camelcase: Replaced by invalid-name (#413)
* [REF] tests: Remove 'score' (#412)
* [REF] openerp-exception-warning: Change to odoo-exception-warning (#411)
* [REF] pylint\_odoo: Sort items for utils.only\_required\_for\_messages (#410)
* [IMP] print-used: Speed-up 'print-used' check avoid inferring (#409)
* [REM] eval-referenced: Replaced by eval-used check from pylint (#408)
* [REF] pylint\_odoo: visit\_dict - Use the dictionary key node (#407)

v8.0.3
------

* [REF] Update "visit\_\*" methods availables and order code and update values (#406)
* [ADD] missing-readme: Add again missing-readme (#405)
* [REF] pylint\_odoo: Clean code (#404)
* [REF] pylint\_odoo: Clean code (#402)

v8.0.2
------

* [REF] codecov, README: Enable codecov again and fix URLs from README (#401)

v8.0.1
------

* [REF] readme: Migrate from RST to MARKDOWN format (#400)
* [REF] pylint\_odoo: Small changes for CI, lints, pytest and code (#399)
* [REF] requirements: Update pylint dependency (#398)
* [IMP] pylint\_odoo: black, isort, prettier (#397)

v8.0.0
------

* [IMP] pylint\_odoo: apocalintSYS - Full refactoring - v8.0.0 (#396)

7.0.4
-----

* [REF] translation-positional-used: Consider srt.format('{} {}') cases (#395)

7.0.3
-----

* [REF] README: Auto-update Using pylint\_odoo.messages2rst()
* [REF] CI: Comment py3.7 travis with weird error unrelated
* [ADD] manifest-data-duplicated: Detect duplicated data file

7.0.2
-----

* [FIX] attribute-string-redundant: Only when field string is the same as title() format (#392)

7.0.1
-----

* [REF] pylint\_odoo: Update supported Odoo version 16.0 (#391)
* [REF] CI: Use py3.10 and 3.11 environments for travis (#389)
* [REF] tests: Add unittest to check only one check enabled (#385)

7.0.0
-----

* [REF] external-request-timeout: Add ftplib.FTP method (#388)
* Revert "[PERF] \*: Checkers only run when enabled #372 (#376)" (#386)
* [PERF] \*: Checkers only run when enabled #372 (#376)
* [FIX] missing-import-error: add xlrd to whitelist (#379)

6.2.0
-----

* [IMP] duplicate-po-message-definition: Detecting duplicated only with msgid (#374)
* [IMP] test-folder-imported: Consider 'from . import test' missing case (#373)

6.1.0
-----

* [REF] README: Auto-update Using pylint\_odoo.messages2rst()
* [ADD] external-request-timeout: It could wait for a long time (#370)
* [FIX] .travis.yml: npm v18.0.0 is not compatible with ubuntu used from travis (#371)
* [REF] README: Use new travis URL (#369)

@antonag32 antonag32 changed the title Draft: [REF] Filter out "bump version" from CHANGELOG [REF] Filter out "bump version" from CHANGELOG Oct 3, 2023
@moylop260 moylop260 merged commit fade82b into OCA:main Oct 3, 2023
17 checks passed
@moylop260 moylop260 deleted the i471-anton branch October 3, 2023 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REF] Changelog: Remove "Bump version: x → y" message
2 participants