Skip to content

Commit

Permalink
changing gem name to puppetlabs-lint after further discussions
Browse files Browse the repository at this point in the history
  • Loading branch information
GSPatton committed Nov 6, 2023
1 parent 174a189 commit 3b7fbd8
Show file tree
Hide file tree
Showing 68 changed files with 102 additions and 102 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM ruby:2.7-alpine

RUN mkdir /puppet-lint /puppet
RUN mkdir /puppetlabs-lint /puppet

VOLUME /puppet
WORKDIR /puppet
ENTRYPOINT ["/puppet-lint/bin/puppet-lint"]
ENTRYPOINT ["/puppetlabs-lint/bin/puppetlabs-lint"]
CMD ["--help"]

COPY . /puppet-lint/
COPY . /puppetlabs-lint/
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@ This tool is only supported on Puppet 7 & 8 environments. In cases where Puppet
Install the Puppet Lint gem by running:

```
gem install puppet-lint
gem install puppetlabs-lint
```

## Testing with Puppet Lint

To test manifests for correct Puppet style, run the `puppet-lint` command with the path to the files you want to test.
To test manifests for correct Puppet style, run the `puppetlabs-lint` command with the path to the files you want to test.

For example:

```
puppet-lint ~/modules/puppetlabs-java/manifests/init.pp
puppetlabs-lint ~/modules/puppetlabs-java/manifests/init.pp
```

```
puppet-lint ~/modules/puppetlabs-mysql/manifests
puppetlabs-lint ~/modules/puppetlabs-mysql/manifests
```

### Fix issues automatically

To instruct Lint to automatically fix any issues that it detects, use the `--fix` flag:

```
puppet-lint --fix /modules
puppetlabs-lint --fix /modules
```

### Modify which checks to run
Expand All @@ -54,13 +54,13 @@ To list all available checks along with basic usage documentation, use the `--li
To run only specific checks, use the `--only-checks` option, with a comma-separated list of arguments specifying which checks to make:

```
puppet-lint --only-checks trailing_whitespace,140chars modules/
puppetlabs-lint --only-checks trailing_whitespace,140chars modules/
```

To avoid enormous patch sets when using the `--fix` flag, use the `--only-checks` option to limit which checks Puppet Lint makes:

```
puppet-lint --only-checks trailing_whitespace --fix modules/
puppetlabs-lint --only-checks trailing_whitespace --fix modules/
```

### Disable Lint checks
Expand All @@ -69,10 +69,10 @@ You can disable specific Lint checks on the command line, disable them permanent

#### Disable checks on the command line

To disable any of the checks when running the `puppet-lint` command, add a `--no-<check_name>-check` flag to the command. For example, to skip the 140-character check, run:
To disable any of the checks when running the `puppetlabs-lint` command, add a `--no-<check_name>-check` flag to the command. For example, to skip the 140-character check, run:

```
puppet-lint --no-140chars-check modules/
puppetlabs-lint --no-140chars-check modules/
```

#### Disable checks within Puppet code
Expand Down Expand Up @@ -123,7 +123,7 @@ Or to specify an allowlist of allowed checks, include a line like:
Please note that there is an important difference between reading options from the command line and reading options from a configuration file: In the former case the shell interprets one level of quotes. That does not happen in the latter case. So, it would make sense to quote some configuration values on the command line, like so:

```
$ puppet-lint --ignore-paths 'modules/stdlib/*' modules/
$ puppetlabs-lint --ignore-paths 'modules/stdlib/*' modules/
```

When reading from a configuration file those quotes would be passed on to the option parser -- probably not giving the expected result. Instead the line should read
Expand All @@ -134,7 +134,7 @@ When reading from a configuration file those quotes would be passed on to the op

## Testing with Puppet Lint as a Rake task

To test your entire Puppet manifest directory, add `require 'puppetlabs/puppet-lint/tasks/puppet-lint'` to your Rakefile and then run:
To test your entire Puppet manifest directory, add `require 'puppetlabs/puppetlabs-lint/tasks/puppetlabs-lint'` to your Rakefile and then run:

```
rake lint
Expand All @@ -153,14 +153,14 @@ PuppetLint::RakeTask.new :lint do |config|
# List of checks to disable
config.disable_checks = ['documentation', '140chars']

# Should puppet-lint prefix it's output with the file being checked,
# Should puppetlabs-lint prefix it's output with the file being checked,
# defaults to true
config.with_filename = false

# Should the task fail if there were any warnings, defaults to false
config.fail_on_warnings = true

# Format string for puppet-lint's output (see the puppet-lint help output
# Format string for puppetlabs-lint's output (see the puppetlabs-lint help output
# for details
config.log_format = '%{filename} - %{message}'

Expand Down Expand Up @@ -239,7 +239,7 @@ validate lint check rubocop-Ruby 2.7.2-Puppet ~> 7:
## Options
See `puppet-lint --help` for a full list of command line options and checks.
See `puppetlabs-lint --help` for a full list of command line options and checks.

## Checks

Expand Down Expand Up @@ -309,7 +309,7 @@ If you have problems getting this tool up and running, please [contact Support](

## Thank you

Many thanks to the following people for contributing to puppet-lint
Many thanks to the following people for contributing to puppetlabs-lint

* James Turnbull (@kartar)
* Jan Vansteenkiste (@vStone)
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'bundler/gem_tasks'
require 'rubocop/rake_task'
require 'github_changelog_generator/task'
require 'puppetlabs/puppet-lint/version'
require 'puppetlabs/puppetlabs-lint/version'
require 'rspec/core/rake_task'
require 'puppetlabs_spec_helper/tasks/fixtures'

Expand All @@ -13,7 +13,7 @@ else
GitHubChangelogGenerator::RakeTask.new(:changelog) do |config|
version = PuppetLint::VERSION
config.user = 'puppetlabs'
config.project = 'puppet-lint'
config.project = 'puppetlabs-lint'
config.since_tag = '2.5.0'
config.future_release = version.to_s
config.exclude_labels = %w[duplicate question invalid wontfix release-pr documentation]
Expand Down
2 changes: 1 addition & 1 deletion bin/puppetlabs-puppet-lint → bin/puppetlabs-lint
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'puppetlabs/puppet-lint'
require 'puppetlabs/puppetlabs-lint'

exit PuppetLint::Bin.new(ARGV).run
20 changes: 10 additions & 10 deletions lib/puppetlabs/puppet-lint.rb → lib/puppetlabs/puppetlabs-lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

require 'set'
require 'json'
require 'puppetlabs/puppet-lint/version'
require 'puppetlabs/puppet-lint/lexer'
require 'puppetlabs/puppet-lint/configuration'
require 'puppetlabs/puppet-lint/data'
require 'puppetlabs/puppet-lint/checks'
require 'puppetlabs/puppet-lint/report/github'
require 'puppetlabs/puppet-lint/bin'
require 'puppetlabs/puppet-lint/monkeypatches'
require 'puppetlabs/puppetlabs-lint/version'
require 'puppetlabs/puppetlabs-lint/lexer'
require 'puppetlabs/puppetlabs-lint/configuration'
require 'puppetlabs/puppetlabs-lint/data'
require 'puppetlabs/puppetlabs-lint/checks'
require 'puppetlabs/puppetlabs-lint/report/github'
require 'puppetlabs/puppetlabs-lint/bin'
require 'puppetlabs/puppetlabs-lint/monkeypatches'

class PuppetLint::NoCodeError < StandardError; end

Expand All @@ -27,7 +27,7 @@ def initialize(token)
end
end

# Public: The public interface to puppet-lint.
# Public: The public interface to puppetlabs-lint.
class PuppetLint
# Public: Gets/Sets the String manifest code to be checked.
attr_accessor :code
Expand Down Expand Up @@ -263,4 +263,4 @@ def self.new_check(name, &block)
# Default configuration options
PuppetLint.configuration.defaults

require 'puppetlabs/puppet-lint/plugins'
require 'puppetlabs/puppetlabs-lint/plugins'
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require 'pathname'
require 'uri'
require 'puppetlabs/puppet-lint/optparser'
require 'puppetlabs/puppet-lint/report/codeclimate'
require 'puppetlabs/puppetlabs-lint/optparser'
require 'puppetlabs/puppetlabs-lint/report/codeclimate'

# Internal: The logic of the puppet-lint bin script, contained in a class for
# Internal: The logic of the puppetlabs-lint bin script, contained in a class for
# ease of testing.
class PuppetLint::Bin
# Public: Initialise a new PuppetLint::Bin.
Expand All @@ -18,21 +18,21 @@ def initialize(args)
@args = args
end

# Public: Run puppet-lint as a command line tool.
# Public: Run puppetlabs-lint as a command line tool.
#
# Returns an Integer exit code to be passed back to the shell.
def run
begin
opts = PuppetLint::OptParser.build(@args)
opts.parse!(@args)
rescue OptionParser::InvalidOption => e
puts "puppet-lint: #{e.message}"
puts "puppet-lint: try 'puppet-lint --help' for more information"
puts "puppetlabs-lint: #{e.message}"
puts "puppetlabs-lint: try 'puppetlabs-lint --help' for more information"
return 1
end

if PuppetLint.configuration.display_version
puts "puppet-lint #{PuppetLint::VERSION}"
puts "puppetlabs-lint #{PuppetLint::VERSION}"
return 0
end

Expand All @@ -42,8 +42,8 @@ def run
end

if @args[0].nil?
puts 'puppet-lint: no file specified'
puts "puppet-lint: try 'puppet-lint --help' for more information"
puts 'puppetlabs-lint: no file specified'
puts "puppetlabs-lint: try 'puppetlabs-lint --help' for more information"
return 1
end

Expand Down Expand Up @@ -107,8 +107,8 @@ def run

return_val
rescue PuppetLint::NoCodeError
puts 'puppet-lint: no file specified or specified file does not exist'
puts "puppet-lint: try 'puppet-lint --help' for more information"
puts 'puppetlabs-lint: no file specified or specified file does not exist'
puts "puppetlabs-lint: try 'puppetlabs-lint --help' for more information"
1
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Public: A class that contains and provides information for the puppet-lint
# Public: A class that contains and provides information for the puppetlabs-lint
# checks.
#
# This class should not be used directly, but instead should be inherited.
Expand Down Expand Up @@ -146,7 +146,7 @@ def fullpath
end

# Public: Provides the path of the file being analysed as it was provided to
# puppet-lint to the check plugins.
# puppetlabs-lint to the check plugins.
#
# Returns the String path.
def path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'puppetlabs/puppet-lint/checkplugin'
require 'puppetlabs/puppetlabs-lint/checkplugin'

# Internal: Various methods that orchestrate the actions of the puppet-lint
# Internal: Various methods that orchestrate the actions of the puppetlabs-lint
# check plugins.
class PuppetLint::Checks
# Public: Get an Array of problem Hashes.
Expand All @@ -13,7 +13,7 @@ def initialize

# Internal: Tokenise the manifest code and prepare it for checking.
#
# path - The path to the file as passed to puppet-lint as a String.
# path - The path to the file as passed to puppetlabs-lint as a String.
# content - The String manifest code to be checked.
#
# Returns nothing.
Expand Down Expand Up @@ -47,7 +47,7 @@ def load_data(path, content)

# Internal: Run the lint checks over the manifest code.
#
# fileinfo - The path to the file as passed to puppet-lint as a String.
# fileinfo - The path to the file as passed to puppetlabs-lint as a String.
# data - The String manifest code to be checked.
#
# Returns an Array of problem Hashes.
Expand Down Expand Up @@ -86,11 +86,11 @@ def run(fileinfo, data)
@problems
rescue StandardError => e
$stdout.puts <<-END.gsub(%r{^ {6}}, '')
Whoops! It looks like puppet-lint has encountered an error that it doesn't
know how to handle. Please open an issue at https://github.com/puppetlabs/puppet-lint
Whoops! It looks like puppetlabs-lint has encountered an error that it doesn't
know how to handle. Please open an issue at https://github.com/puppetlabs-lint
and paste the following output into the issue description.
---
puppet-lint version: #{PuppetLint::VERSION}
puppetlabs-lint version: #{PuppetLint::VERSION}
ruby version: #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}
platform: #{RUBY_PLATFORM}
file path: #{fileinfo}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Public: A singleton class to store the running configuration of
# puppet-lint.
# puppetlabs-lint.
class PuppetLint::Configuration
# Internal: Add helper methods for a new check to the
# PuppetLint::Configuration object.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'strscan'
require 'set'
require 'puppetlabs/puppet-lint/lexer/token'
require 'puppetlabs/puppet-lint/lexer/string_slurper'
require 'puppetlabs/puppetlabs-lint/lexer/token'
require 'puppetlabs/puppetlabs-lint/lexer/string_slurper'

# Internal: A generic error thrown by the lexer when it encounters something
# it can't handle.
Expand Down Expand Up @@ -32,7 +32,7 @@ def to_s
end
end

# Internal: The puppet-lint lexer. Converts your manifest into its tokenised
# Internal: The puppetlabs-lint lexer. Converts your manifest into its tokenised
# form.
class PuppetLint::Lexer
def initialize
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 3b7fbd8

Please sign in to comment.