Skip to content

chore: allow windows developers to work with this repo without hassle - #5686

Merged
bwajtr merged 3 commits into
mainfrom
chore/support-for-windows-developers
Mar 28, 2023
Merged

bwajtr merged 3 commits into
mainfrom
chore/support-for-windows-developers

Conversation

@bwajtr

@bwajtr bwajtr commented Mar 17, 2023 •

Copy link
Copy Markdown
Contributor

Description

  • The default value of endOfLine check in Prettier changed from auto to LF in version 2.0.0. This is very inconvenient for Windows developers. Because when you install git on Winwows, you'll automatically have core.autocrlf set to true, which will basically change all LF line endings to CRLF line endings when you clone the repository. Git then ensures that CRLF is converted back to LF on commit. However, because you have CRLF locally, Prettier checks fail. The solution to this is to not enforce line endings by Prettier, but actually, let git handle it automatically.
    • I've set Prettier 'endOfLine' to auto again, so Prettier ignores it
    • Introduced .gitattributes file, which enables git to handle CRLF to LF conversion for Windows developers automatically, regadless of their local settings of core.autocrlf. Git makes sure, thanks to this file, that remote will always contain only LF. Topic is explained here.
  • Introduced very basic .editorconfig - basically to remove the need to manually set the line length to 120 in editors which respect .editorconfig (for example Intellij Idea does and .editorconfig by default overrides any settings made by the developer)
  • Additionally fix of some *.js scripts so they are runnable also on Windows machines
  • Also added .idea directory to .gitingore so IntelliJ Idea project files are ignored when you work with the repository in Idea

Type of change

[x] Chore

Comment thread .gitattributes Resolved
Comment thread wtr-utils.js Resolved
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@bwajtr bwajtr self-assigned this Mar 21, 2023
@bwajtr
bwajtr requested review from web-padawan and yuriy-fix March 21, 2023 12:23
@bwajtr
bwajtr merged commit b705fbd into main Mar 28, 2023
@bwajtr
bwajtr deleted the chore/support-for-windows-developers branch March 28, 2023 11:58
@vaadin-bot

Copy link
Copy Markdown
Collaborator

Hi @bwajtr , this commit cannot be picked to 24.0 by this bot, can you take a look and pick it manually?
Error Message: Error: Command failed: git cherry-pick b705fbd
error: could not apply b705fbd... chore: allow windows developers to work with this repo without hassle (#5686)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 24.1.0.alpha2 and is also targeting the upcoming stable 24.1.0 version.

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.

4 participants