Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve data types #193

Merged
merged 6 commits into from
Jan 9, 2025
Merged

Improve data types #193

merged 6 commits into from
Jan 9, 2025

Conversation

smortex
Copy link
Member

@smortex smortex commented Aug 30, 2023

Some data types allow invalid values. Tighten the data types to make it harder to build broken configuration.

@smortex smortex changed the title improve data types Improve data types Aug 30, 2023
@smortex smortex force-pushed the improve-data-types branch 4 times, most recently from 1bd0acc to b9a9dbe Compare August 30, 2023 20:59
@smortex smortex marked this pull request as ready for review August 30, 2023 23:06
@smortex smortex added the enhancement New feature or request label Oct 9, 2024
@TheMeier
Copy link
Contributor

TheMeier commented Jan 4, 2025

LGTM. But why are the test not run?

Optional[String] $pki_keypair = undef,
Optional[String] $pki_master_key = undef,
Optional[String] $plugin_dir = undef,
Array[String[1]] $packages,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all these spaces in class parameters make things worse. In the worst case, when a paremeter is added or removed, all other parameters need to be aligned again. Sure, these spaces slightly improve readability, but I don't think it's worth it (and it is not covered by puppet-lint).

This PR would be a great opportunity to drop all spaces in class parameters.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually prefer the align variable name and align value style. And the re-indentation on change is not a big issue IMHO. I've seen this discussion before. I think we should have a voxpupuli styleguide (and linter) that finally defines the desired layout. Maybe something to discuss on the ML?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was discussed a few times with no consensus as some people can bear it and other people need it to work efficiently, and the status quo is basically "just let people who work with a module do as they like as long as each commit does not switch from one style to another": voxpupuli/voxpupuli.github.io#322

Anyway, be aware that there is an option to not show white-space changes on GitHub (the UI is crappy as hell to find it, the option is on the diff tab, before the actual diff). This makes such annoyances much lower when they happen.

A negative value or 0 are not valid and should not be accepted by the
module.
In a future major version, we will remove the support for non-sensitive
passwords and stop providing a default value for them.
All user provided String are expected to be non-empty when they are not
undef.
@smortex smortex force-pushed the improve-data-types branch from b9a9dbe to 1bc1da9 Compare January 8, 2025 02:40
@smortex smortex merged commit f7e03b4 into master Jan 9, 2025
5 checks passed
@smortex smortex deleted the improve-data-types branch January 9, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants