| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Do regex checks without creating objects for the results.
Signed-off-by: Tim Smith <tsmith@chef.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this change we will now fail the run when a cookbook contains two same-named
YAML files with different extensions. THis is because we don't know which one to use -
either one is a valid YAML file extension. Instead of picking one
arbitrarily we'll fail with an error explaining how to resolve it.
For example if the cookbook contains both recipes/default.yaml and recipes/default.yml
it will fail with the following output:
Cookbook test1@0.1.0 contains ambiguous files: recipes/default.yaml and recipes/default.yml. Please update the cookbook to remove the incorrect file.
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support for recipe files that end in the '.yaml'
extension in addition to existing support for '.yml', because
both are valid and common extensions for yaml files.
Of note is that the message we log when a recipes/default.y[a]ml
and a root_files/recipe.y[a]ml both exist will be slightly off, in that
we don't capture the actual extension of each file. This seems to be
more complexity than it was worth, for a message that is shown at the
beginning of the run and largely ignored.
I also tried to add a bit of localized unit testing for
`recipe_yml_filenames_by_name` because we didn't before. Mostly focuses
on this use case (yaml, yml both work) but we could probalby improve
that by including tests for a mix of yaml/yml files.
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|
|
|
|
|
| |
* Use ||= where we can
Signed-off-by: Tim Smith <tsmith@chef.io>
|
|
|
|
|
|
| |
So much easier to read and probably faster this way too.
Signed-off-by: Tim Smith <tsmith@chef.io>
|
|
|
|
|
|
| |
Autocorrected from RuboCop Performance which is now smart enough to detect when you use the match and when you don't. Using match? does not create any objects so it's slightly faster and uses less memory.
Signed-off-by: Tim Smith <tsmith@chef.io>
|
|
|
|
| |
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
|
|
|
|
|
|
| |
Autocorrected with chefstyle after enabling that cop. It was very hard to read some complex autocorrected blocks w/o this.
Signed-off-by: Tim Smith <tsmith@chef.io>
|
|
|
|
|
|
|
|
| |
Legally incredibly dubious, particularly since we don't follow it
strictly as policy, and we have git history instead, which does it right.
This is just a waste of time and a cargo cult.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
| |
validate name field
Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
|
|
|
|
|
|
| |
deletes the local copy of it from chef repo
Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
|
|
|
|
|
|
|
| |
given how many regexps we have with /'s in the match this seems like
a very good one.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
| |
start enforcing using %i{} instead of arrays of symbols
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
| |
i like this one, gives visual priority to returns or raises that are
buried in the middle of things.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
| |
This gives a speed boost since rubygems does not have to scan through
every gem in the gemset in order to find the file.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
| |
includes backcompat for 2.5
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
|
|
|
| |
to_hash on a lot of these objects should go away, but even eliminating
all our calls to to_hash on these objects internally is difficult.
(e.g. converting the knife ui code to call #to_h means we wind up
calling nil#to_h which "helpfully" becomes '{}' which is hilarious and
i don't know why someone thought that was a good idea).
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Scott McGillivray <scott.mcgillivray@gmail.com>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
| |
absolutely hard requirement on the fixes that went into chef-config 2.2.11, so the
floor of that gem is bumped up.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
| |
closes #1479
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
| |
We weren't consistently naming root files; in some places in the spec
the names contained the `root_files` segment and in other places they
didn't. This now always uses `root_files`.
Signed-off-by: Thom May <thom@chef.io>
|
|
|
|
| |
Signed-off-by: Thom May <thom@chef.io>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
|
|
|
|
| |
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
|
|
|
|
| |
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
|
|
|
|
|
|
|
|
|
| |
This implements RFC 67, which removes cookbook segments, and moves to a
single list of all the files contained in a cookbook. This allows us to
move forward with better audit modes and also proper shipping of ohai
plugins.
Signed-off-by: Thom May <thom@chef.io>
|
|
|
|
| |
Signed-off-by: Thom May <thom@chef.io>
|
|
|
|
|
|
| |
department of redundancy department
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
|
|
|
|
| |
This adds URLs to each class of deprecation, and correctly prints and
formats them for maximum user efficiency. We also provide the URL to the
data collector for Visibility to ingest.
Signed-off-by: Thom May <thom@chef.io>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
|
|
|
| |
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `preferred_manifest_record` function pretty prints the list of
existing files when the asked file can't be found. To do that, the root
path of the cookbook is removed from each existing file but the update
is done on the `existing_files` variable, not on a copy. When called
several times, this variable will eventually be equals to `[nil]`,
leading to a NoMethodError.
Without the fix, the new unit test fails with
> expected Chef::Exceptions::FileNotFound, got #<NoMethodError: undefined method `[]' for nil:NilClass> with backtrace:
> # ./lib/chef/cookbook_version.rb:321:in `block in preferred_manifest_record'
> # ./lib/chef/cookbook_version.rb:319:in `map!'
> # ./lib/chef/cookbook_version.rb:319:in `preferred_manifest_record'
> # ./spec/unit/cookbook_version_file_specificity_spec.rb:318:in `block (3 levels) in <top (required)>'
> # ./spec/unit/cookbook_version_file_specificity_spec.rb:317:in `block (2 levels) in <top (required)>'
Fixes #2561.
|
|\
| |
| | |
Autofixing new Perf cops in 0.37.2
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
6 Performance/Casecmp
18 Performance/Detect
1 Performance/RangeInclude
27 Performance/RedundantBlockCall
6 Performance/RedundantMatch
5 Performance/RedundantMerge
18 Performance/StringReplacement
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
4174 Style/SpaceInsideHashLiteralBraces
1860 Style/SpaceAroundOperators
1336 Style/SpaceInsideBlockBraces
1292 Style/AlignHash
997 Style/SpaceAfterComma
860 Style/SpaceAroundEqualsInParameterDefault
310 Style/EmptyLines
294 Style/IndentationConsistency
267 Style/TrailingWhitespace
238 Style/ExtraSpacing
212 Style/SpaceBeforeBlockBraces
166 Style/MultilineOperationIndentation
144 Style/TrailingBlankLines
120 Style/EmptyLineBetweenDefs
101 Style/IndentationWidth
82 Style/SpaceAroundBlockParameters
40 Style/EmptyLinesAroundMethodBody
29 Style/EmptyLinesAroundAccessModifier
1 Style/RescueEnsureAlignment
|
|
|
| |
Generated via git ls-files | xargs perl -pi -e "s/(Author.*?<[^@]+@)(?:opscode\\.com|getchef\\.com)(>)/\\1chef.io\\2/gi"
|
|
|
| |
Generated via git ls-files | xargs perl -pi -e "s/[Cc]opyright (?:\([Cc]\) )?((?\!$(date +%Y))\\d{4})(-\\d{4})?([, ][ \d]+)*(,|(?= ))/Copyright \\1-$(date +%Y),/g"
|
| |
|
|
|
|
|
|
|
| |
This is an entirely mechanically generated (chefstyle -a) change, to go
along with chef/chefstyle#5 . We should pick something and use it
consistently, and my opinion is that double quotes are the appropriate
thing.
|
| |
|
|
|
|
|
|
|
| |
In the process, stop auto-expanding JSON in the HTTP client, and let
individual classes control that themselves.
Fixes #2737, Fixes #3518
|