Skip to content

Conversation

@larsewi
Copy link
Contributor

@larsewi larsewi commented Aug 27, 2025

  • pretty.py: removed unnecessary call to len()
  • pretty.py: un-nested functions to decrease complexity
  • pretty.py: split encoding of list into two functions
  • pretty.py: split encoding of dict into two functions
  • pretty.py: implemented single line encoder for lists
  • pretty.py: implemented single line encoder for dict
  • pretty.py: renamed a variable
  • pretty.py: line length wrapping takes comma into consideration
  • Added unit tests comparing cfbs pretty with output from npm prettier

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
@larsewi larsewi force-pushed the not-pretty-enough-for-you branch from 1ca4256 to ddfc6c6 Compare August 27, 2025 16:23
@larsewi larsewi changed the title CFE-4571: Is cfbs pretty not pretty enough for you? CFE-4571: Even prettier cfbs pretty Aug 28, 2025
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: CFE-4571
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: CFE-4571
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
@larsewi larsewi force-pushed the not-pretty-enough-for-you branch 2 times, most recently from fde0bca to 5faaacc Compare August 28, 2025 10:20
Ticket: CFE-4571
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
@larsewi larsewi force-pushed the not-pretty-enough-for-you branch from 5faaacc to 2583839 Compare August 28, 2025 10:33
@larsewi larsewi marked this pull request as ready for review August 28, 2025 10:37
We saw some cases where cfbs pretty and npm prettier did not agree.
These tests prove that they now agree for those specific cases.

Ticket: CFE-4571
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
@larsewi larsewi force-pushed the not-pretty-enough-for-you branch from 2583839 to d2a3e40 Compare August 28, 2025 10:39
@olehermanse olehermanse merged commit 0723f73 into cfengine:master Aug 28, 2025
11 checks passed
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