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

AA style #30

Open
elsassph opened this issue May 25, 2021 · 5 comments · Fixed by #40
Open

AA style #30

elsassph opened this issue May 25, 2021 · 5 comments · Fixed by #40
Labels
help wanted Extra attention is needed

Comments

@elsassph
Copy link
Collaborator

What options do we want for AA literals?

a = {
  a1: 1
  a2: 2
}
b = { b1: 1, b2: 2 }

What about commas? Commas are optional - I'm thinking options could be:

  • always: every line should end with a comma (even last of a block)
  • no-trailing: every line should end with a comma, excepted last field
  • never: no commas

Does that work both for multi-line/one-line literals?

Other things related to linting? I don't think using quotes should be enforced as it changes the semantics of the AA.

@elsassph elsassph added the help wanted Extra attention is needed label May 25, 2021
@chrisdp
Copy link

chrisdp commented May 25, 2021

I think the options you have for trailing comas is good. Keep in mind this can also apply for arrays so a more general rule for trailing comas might be good.

Comas are required for single line or same line values. Again this also applies to arrays.

For quotes I can still see value in a rule for it. I would think by default the rule would be no enforcement. And if you want a never rule then case can be enforced in code with something like:

myAa = {}
myAa["A"] = 1

I have had this as a rule for many projects.

@georgejecook
Copy link
Contributor

this seems right to me.

@elsassph
Copy link
Collaborator Author

@chrisdp ok so AA keys options to optionally enforce quote / no-quote (and obviously off)?

@chrisdp
Copy link

chrisdp commented May 25, 2021

@elsassph Yes that sounds right.

@elsassph
Copy link
Collaborator Author

Reopning because we still want AA key quotes rules.

@elsassph elsassph reopened this Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants