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

DOCS: Trailing commas #2851

Merged
merged 4 commits into from
Feb 26, 2024
Merged

Conversation

cafferata
Copy link
Collaborator

@cafferata cafferata commented Feb 24, 2024

@tlimoncelli
Copy link
Contributor

I'm not sure people will understand the + and - notation. Maybe some other way to show the change?

@tlimoncelli
Copy link
Contributor

yes! The "before vs. after" is much more readable.

I'd add some narrative after the "after" to explain the benefit. Maybe something like: Suppose you want to add a new record after the "bar" line. In the "before" example, the diff would show the addition of the comma on the "bar" line plus the new record you added. In the "after" example the diff would be just the added record. This creates PRs that are easier to approve.

(Feel free to reword that! It's just the first thing that came to my head.)

@cafferata
Copy link
Collaborator Author

Great! I've added two commits:

  1. A introduction to trailing commas.
  2. Version-control diffs examples based on the code examples.

What do you think of this version?
https://docs.dnscontrol.org/~/revisions/lvH3LKLmIEEQOXJyYvIs/advanced-features/code-tricks#trailing-commas

@tlimoncelli
Copy link
Contributor

Hey that's great! Thanks!

@tlimoncelli tlimoncelli merged commit 11d8e08 into StackExchange:main Feb 26, 2024
6 checks passed
@cafferata cafferata deleted the docs/trailing-commas branch February 26, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOCS: Trailing commas
2 participants