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

Fixed pretty formatting of first cfbs init commit #182

Merged
merged 4 commits into from
Jan 11, 2024

Conversation

olehermanse
Copy link
Member

  • De-duplicated cfbs sorting rules
  • Renamed sorting rule variables
  • Fixed pretty formatting of first cfbs init commit
  • Updated imports for top level keys and module keys

Introduced here:
cfengine#181

Signed-off-by: Ole Herman Schumacher Elgesem <[email protected]>
One can be local with underscore prefix, the other can use
all caps like the other globals.

Signed-off-by: Ole Herman Schumacher Elgesem <[email protected]>
Signed-off-by: Ole Herman Schumacher Elgesem <[email protected]>
Signed-off-by: Ole Herman Schumacher Elgesem <[email protected]>
@olehermanse olehermanse merged commit 7793c67 into cfengine:master Jan 11, 2024
7 checks passed
@olehermanse olehermanse deleted the pretty branch January 11, 2024 19:54
cfbs/commands.py Show resolved Hide resolved
@@ -207,7 +209,10 @@ def init_command(index=None, masterfiles=None, non_interactive=False) -> int:

config["git"] = do_git

write_json(cfbs_filename(), config)
data = pretty(config, CFBS_DEFAULT_SORTING_RULES) + "\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: Why not write it through the cfbs_json object like we do most other things?

Copy link
Member Author

Choose a reason for hiding this comment

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

@oleorhagen We can and probably should. It looked like a bit more refactoring than I wanted to do in this commit. (I think CFBSConfig class has some quirks which make it a bit weird to work with before there is a .json file, with the expected fields, at the expected path).

Copy link
Member Author

Choose a reason for hiding this comment

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

Feel free to take a stab at it, shouldn't be very hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants