Socket
Book a DemoInstallSign in
Socket

puppet-lint-i18n

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

puppet-lint-i18n

1.0.0
bundlerRubygems
Version published
Maintainers
2
Created
Source

puppet-lint-i18n plugin

Installation

To use this plugin, add the following like to the Gemfile in your Puppet code base and run bundle install.

gem 'puppet-lint-i18n'

Usage

This plugin provides a new check to puppet-lint. It will detect functions that do not have their output message wrapped in a translate call.

Functions detected

  • warning
  • fail

Before and after

For example the following puppet code does not wrap the message

warning('message')

wrapping the message then looks like

warning(translate('message'))

Example output

WARNING: 'warning' messages should be decorated: eg translate('old_root_password is no longer used and will be removed in a future release') on line 48

This tells you which file and what line the infringement occurred, as well as the suggested fix

Other Infringements

  • Multiline strings

BAD

warning(translate('to be or') / 
translate('not to be'))

GOOD

warning(translate('to be or not to be')
  • Concatenated strings
  • Heredoc strings

The :HEREDOC_OPEN token (@(EOL)) should be the only part passed to the translate() function. Do not pass the entire heredoc.

BAD

warning(translate(@(EOL)
  This is a heredoc.
  It's lovely. 
  | EOL))

GOOD

warning(translate(@(EOL))
  This is a heredoc.
  It's lovely. 
  | EOL)
  • Interpolated strings

Interpolated strings are not supported at this time and will not be decorated with the fix option.

Fix issues automatically

--fix support: Yes

Disabling checks

Please refer to the documentation here [https://github.com/rodjek/puppet-lint#disable-lint-checks]

FAQs

Package last updated on 15 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.