Skip to content

feat: added extension 'Spotless Gradle', configured so it runs spotlessApply - Xavier Cruz #436

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"mechatroner.rainbow-csv",
"alexcvzz.vscode-sqlite",
"Orta.vscode-jest",
"firsttris.vscode-jest-runner"
"firsttris.vscode-jest-runner",
"richardwillis.vscode-spotless-gradle"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[java]": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not working when I test locally. Did you test this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested it, it worked locally. Maybe something in the configuration is messed up? I'll check this out tmr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after some further digging it looks like the activation events for this plugin are
workspaceContains:gradlew
workspaceContains:gradlew.bat

and since gradle is inside of the children folders and not the parent workspace i dont think it will work. Ill make a new repo and test this out

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup that was the issue. It works as intended in the new repository, even lints when something is not spotless

Screenshot 2024-10-25 at 1 03 35 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another extension which is more bare bones thats called Run On Save. the only issue im facing currently is how to determine where the java project was created at.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I was proud to see your feature request in the plugin repo when I walked the TAs through the issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

"spotlessGradle.format.enable": true,
"editor.defaultFormatter": "redhat.java",
},

}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.codedifferently.lesson12;

public class ListNode {

int val;
ListNode next;

ListNode() {}
ListNode() {
}

ListNode(int val) {
this.val = val;
Expand Down
Empty file.
Loading