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

OCA / pylint-odoo / 660 / 3
98%
master: 98%

Build:
DEFAULT BRANCH: master
Ran 22 May 2018 10:14PM UTC
Files 7
Run time 1s
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

22 May 2018 10:10PM UTC coverage: 99.823% (+0.002%) from 99.821%
TOXENV=py34-pylint14

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

1127 of 1129 relevant lines covered (99.82%)

1.0 hits per line

Source Files on job 660.3 (TOXENV=py34-pylint14)
  • Tree
  • List 0
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 652
  • Travis Job 660.3
  • cd961813 on github
  • Prev Job for TOXENV=py34-pylint14 on master (#655.3)
  • Next Job for TOXENV=py34-pylint14 on master (#662.3)
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