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

Aligning formatting across files #1926

Closed
egekorkan opened this issue Nov 22, 2023 · 2 comments · Fixed by #1960
Closed

Aligning formatting across files #1926

egekorkan opened this issue Nov 22, 2023 · 2 comments · Fixed by #1960
Assignees
Labels
Tooling topics around tooling for the specification

Comments

@egekorkan
Copy link
Contributor

egekorkan commented Nov 22, 2023

Similar to binding templates repository, we can add an editorconfig file so that :

  • The documents we need to edit the source code of is easier to do and we avoid unwanted whitespace changes.
  • Some documents like JSON Schema can be also read by developers so we should provide a "nice looking" document to them.
  • We have a convention on when to do line breaks. Having multiple sentences in one line is annoying for git diffs, which makes reviewing, and suggesting difficult.

I would exclude files that are auto-generated and also all the existing HTML files in the publication folder.

@github-actions github-actions bot added the needs-triage Automatically added to new issues. TF should triage them with proper labels label Nov 22, 2023
@ashimura ashimura added the Tooling topics around tooling for the specification label Nov 22, 2023
@egekorkan egekorkan removed the needs-triage Automatically added to new issues. TF should triage them with proper labels label Nov 23, 2023
@egekorkan
Copy link
Contributor Author

egekorkan commented Dec 20, 2023

Call of 20.12:

  • We should also use a format in the CI pipeline to fix such misformating when somebody edits via GitHub or editor without editorconfig support.
  • We can use Prettier instead of editorconfig but it may not work in IDEs other than VS Code.
  • We should hook it up to husky
  • There will be no impact for reviewers since we use HTML diff anyways
  • We can start with editorconfig, check it works and then use Prettier on top.
  • Spaces for indentation, UNIX ending (since W3C server is unix-based).
  • We should add gitattribute so that the first clone is using the correct line ending.

@egekorkan egekorkan self-assigned this Dec 20, 2023
@egekorkan
Copy link
Contributor Author

After trying to get prettier to work with editorconfig, I have found prettier/prettier#15255 (comment) which says that prettier will always read the editorconfig file but it does not really take the excluded parts into account. So I propose to maintain two configurations but keep them consistent.

@egekorkan egekorkan changed the title Aligning formatting accross files Aligning formatting across files Jan 18, 2024
@egekorkan egekorkan linked a pull request Jan 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tooling topics around tooling for the specification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants