-
Notifications
You must be signed in to change notification settings - Fork 356
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
Apply Editorconfig checking to the build #856
Conversation
fb4ff77
to
84930ad
Compare
@nschonni, looks like a great addition to the build process. Given this touches 134 files, my primary concern with merging now is the potential headache for everyone actively working in branches right now. We have a bunch of active projects in flight at this time. They will all have to rebase or merge master into their work, and it looks like this could create a ton of conflicts. Or, will git be able to automatically resolve all them just because they are white space changes? Will it get them right? I wonder if it would be better to wait until we have fewer people and projects that could be effected. Closer to December release time, the major projects will all be merged into master. |
Not sure, I think when the same line is editted, then there will be conflicts.
That's fine with me. I split this into 3 commits, and the last one is the one that contains all the file changes. When it's ready that commit can be redone. Alternately, this could be turned on for selected folders that don't have pending PRs and eventually changed to a global check |
@sh0ji, the stylelint work is now successfully merged into all 10 active branches. So, we are ready to go forward with work on this one. |
84930ad
to
e5d0b82
Compare
Bad rebase, hold on |
e5d0b82
to
b5c1153
Compare
@sh0ji I'm running into an issue with the Husky setup
|
Very weird, I'm seeing the same thing on your branch when I run |
It might be windows related since I rebased there last. I'll probably look at adding the encoding and line ending of |
b5c1153
to
c61c9aa
Compare
Redid this on my Mac and it seems happy again. I'll try pulling this down on my windows machine later to see if I get the same issue |
Great, it's working for me as well. Random thought: is there a risk in using |
I don't think so, because ECLint is kind of simple. It will mostly just convert tabs and spaces to their equivalent and basic line endings. StyleLint and ESLint have more smarts, and will indent with context of function levels. I think the only time that they'd conflict is if the settings conflict (EX: EditorConfig says 3 spaces and ESLint say 4). |
Double checking to make sure that all the changes in c61c9aa are strictly white space, I did the following:
Why would these 2 binary files have been touched by this? I'm not sure whether this is a concern. |
I had ignored one of the paint files, but I'll added the file type instead since I guess those got added after my first pass. Might be better to remove them if they aren't needed, but that can be a separate thing |
We should get rid of the paint files and at some point covert the arrows to SVG. But for now we should just delete the paint files. |
The task force has some concerns about maintaining this file since there seem to be quite a few exceptions to the rules. @mcking65, I suspect the ideal way to handle this would be to keep all of our dependencies and vendor files separate from the project source so that we could just ignore those files entirely (starting to feel like node_modules). As it is, our dependencies are in quite a few different places, which Nick enumerated in Line 33 in c61c9aa
@nschonni, do you have any suggestions for how we could make this more maintainable? |
Now that we are having editorconfig touch every file commited, I'm wondering why have the first section of .editorconfig that touches every file? Normally, editorconfig is only used by an editor when a file is editted. And, typically, people do not edit binaries with editors that use ec. However, when running it this way, isn't it touching every single file that gets commited? That would then touch lots of files that ec would normally not touch. If I'm understanding correctly, we could simplify just by telling ec to only work on specific types of files. Then, we need only ignore 3rd party files of those types. |
@jongund, if we are going to get rid of the paint files, we should do that separately, not part of this PR. So, you say delete them ... does that mean they are never used? If so, I'd be happy to have a separate PR that only deletes the unused files. |
I can try pushing the values currently set under the |
Oops, @nschonni, now I've created conflicts by merging #993. @nschonni commented:
That seems reasonable to me.
Are you thinking that if we do that, then EC would go ahead and touch every file anyway and use some set of defaults rather than we what we now have set for all files? I hope it doesn't work that way.
I'm not clear what you mean with this alternative. Where would this change be made? Do you mean change line 16 in .editorconfig to specify file types? That seems equivalent to the first option you suggested. Basically, my concern is that it doesn't seem like we should let EC have any opinions about unknown file types. We know exactly what we want in js, css, html, and md. In any other type of file, the format really doesn't matter. If there is another type for which we have opinions, we should add it specifically rather than apply some default opinions indiscriminately. For instance, maybe we care about encoding and line endings in svg and txt files; if so, we could add those specifically. But, we should not have to explicitly exclude every binary file that lands in the repo. |
c61c9aa
to
41b3b7a
Compare
Rebased and added a |
@nschonni ... I assume there is a white space conflict somewhere in that block starting at line 5006 in aria-practices.html? I can't find the difference. |
Yeah, looks like a tab/space thing. I'll try rebasing again later today |
@@ -0,0 +1,7 @@ | |||
# Set the default behavior, in case people don't have core.autocrlf set. | |||
* text=auto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of applying to all files, shouldn't we explicitly state which files we consider text? I get concerned about git thinking a file is text but it is binary. In the future, if someone adds a binary file, isn't aware of this, and if git makes a mistake, it could cause problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can, but this is the common file patter you'll see in other repos. If a new binary files get added, then i believe it will just try to treat it as diff'able. I think that would be same behaviour as today without this file though
Unfortunately, I'm really struggling with this pr b/c Chrome and Firefox both seem to hang on me when I use most features on the files tab or even if I open a single commit. I don't know if it is realted to JAWS or not, but I don't think so because it is a script execution problem. I am looking at the files locally, but that makes it harder to see what has changed. |
Is the Patch URL any better https://patch-diff.githubusercontent.com/raw/w3c/aria-practices/pull/856.patch |
836ff83
to
8afef95
Compare
@mcking65 rebased for the conflict |
I want to figur out how to move this forward. It seems like eclint could improve the consistency and thus readability of our source formatting. I am going to first land this in a feature branch called add-eclint. Then any of us can contribute to it and it will be a little easier to work on it from the CLI. I still can't look at the files tab in this PR. It just won't load for me when JAWS is running. Then, before merging, I want to make sure that:
Just slap me if I am being overly conservative or careful. I just feel like any change that touches 144 files and every file checked in down the road deserves an extra bit of scrutiny. I want to know what I am doing :). |
Adds https://github.com/jedmao/eclint to the
lint
andfix
targets to apply those settings from the EditorConfig file.The tool is not language aware, so it doesn't really format the indenting like a full IDE, but does best guess to remove extra leading space. There were a few places where it looked like adding rounding the spaces up rather than down was better so I manually changed those.
I also added the setting for comment blocks which added to the number of JS files touched.
Preview | Diff