[PUP-9190] Puppet should ignore empty init.pp Created: 2018/10/01 Updated: 2018/10/24 Resolved: 2018/10/23
|Fix Version/s:||PUP 5.5.7, PUP 6.0.3|
|Reporter:||Josh Cooper||Assignee:||Kris Bosland|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
|Sprint:||Platform Core KANBAN|
|Method Found:||Needs Assessment|
|Release Notes:||Bug Fix|
|Release Notes Summary:||Empty or comments only files will no longer emit a deprecation warning or error about illegal top level construct.|
|QA Risk Assessment:||Needs Assessment|
Puppet6 will error if a module contains an empty init.pp. The module documentation says, "init.pp: Contains a class definition. The init.pp class, if used, is the main class of the module. This class's name must match the module's name."
So the init.pp file is optional, but we don't specify whether the file can exist, but be empty or if it only contains a defined type.
We discovered in
|Comment by Henrik Lindberg [ 2018/10/01 ]|
Uh oh, that sounds as a bug in the checker - if it is empty it should not find a class in that file and should have nothing at all to verify, seems like it goes off the road with a strange error message.
|Comment by Kris Bosland [ 2018/10/08 ]|
|Comment by Charlie Sharpsteen [ 2018/10/08 ]|
Allowing any .pp file to be empty seems less complicated all around to me.
|Comment by Henrik Lindberg [ 2018/10/09 ]|
Well, some files cannot really be empty, but those are checked by the loaders (functions and data types in .pp files for example). Validation should just accept "empty" files ("empty" here meaning no resulting AST as there could example be comments etc. so file may not be exactly void of content to be considered empty).
|Comment by Josh Cooper [ 2018/10/11 ]|