• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OCA / pylint-odoo / 660
98%

Build:
DEFAULT BRANCH: master
Ran 22 May 2018 10:13PM UTC
Jobs 4
Files 7
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
660

push

travis-ci

moylop260
[ADD] Add new lint to detect variables within translatable strings (#198)

As stated in the Odoo documentation [1], when translations need to
reference variables, they should be outside the function `_(...)`,
because they might not work as expected. For example, expressions like
the following should be avoided:
`_("Scheduled meeting with %s" % invitee.name)`

Instead, the following should be used:
`_("Scheduled meeting with %s") % invitee.name`

This change adds a new lint to detect badly-former expressions like the
above, and to suggest the correct way to achieve the desired behavior.

In addition, this adds eight cases of badly-formed expressions. There
are in total ten expected errors, because there were already two cases:
- https://github.com/OCA/pylint-odoo/blob/8845b74/pylint_odoo/test_repo/broken_module/models/broken_model.py#L298
- https://github.com/OCA/pylint-odoo/blob/8845b74/pylint_odoo/test_repo/broken_module/models/broken_model.py#L302

[1] https://www.odoo.com/documentation/11.0/reference/translations.html#variables

Closes #194

12 of 12 new or added lines in 1 file covered. (100.0%)

1129 of 1129 relevant lines covered (100.0%)

4.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 660.1 (TOXENV=py27-pylint14) 22 May 2018 10:13PM UTC 0
100.0
Travis Job 660.1
2 660.2 (TOXENV=py27-pylint20) 22 May 2018 10:14PM UTC 0
100.0
Travis Job 660.2
3 660.3 (TOXENV=py34-pylint14) 22 May 2018 10:14PM UTC 0
99.82
Travis Job 660.3
4 660.4 (TOXENV=py35-pylint20) 22 May 2018 10:13PM UTC 0
99.82
Travis Job 660.4
Source Files on build 660
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #660
  • cd961813 on github
  • Prev Build on master (#655)
  • Next Build on master (#662)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc