You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2020/10/03 08:18:51 UTC

[GitHub] [submarine] ByronHsu opened a new pull request #426: SUBMARINE-652. Autoformat staged files before committing

ByronHsu opened a new pull request #426:
URL: https://github.com/apache/submarine/pull/426


   ### What is this PR for?
   Although we applied prettier in the workbench. However, even if the code format violates the rule, we can still commit the code.
   In that way, prettier might become useless, so we should autoformat the file in precommit.
   
   Therefore, I use husky + lint-staged to construct a mechanism which can automatically format only staged file in git, which is quite efficient and convenient.
   
   ### What type of PR is it?
   [Improvement]
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   https://issues.apache.org/jira/browse/SUBMARINE-652
   
   ### How should this be tested?
   https://travis-ci.org/github/ByronHsu/submarine/builds/732470123
   
   ### Screenshots (if appropriate)
   <img width="494" alt="Screen Shot 2020-10-03 at 4 01 01 PM" src="https://user-images.githubusercontent.com/24364830/94986774-07daa380-0594-11eb-9ef5-e39aad54f716.png">
   
   ### Questions:
   * Does the licenses files need update? Yes/No
   * Is there breaking changes for older versions? Yes/No
   * Does this needs documentation? Yes/No
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [submarine] ByronHsu commented on pull request #426: SUBMARINE-652. Autoformat staged files before committing

Posted by GitBox <gi...@apache.org>.
ByronHsu commented on pull request #426:
URL: https://github.com/apache/submarine/pull/426#issuecomment-703703698


   @pingsutw Can you please review this PR? Thanks!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [submarine] ByronHsu commented on a change in pull request #426: SUBMARINE-652. Autoformat staged files before committing

Posted by GitBox <gi...@apache.org>.
ByronHsu commented on a change in pull request #426:
URL: https://github.com/apache/submarine/pull/426#discussion_r499135581



##########
File path: submarine-workbench/workbench-web-ng/package.json
##########
@@ -49,14 +53,16 @@
     "codelyzer": "^5.1.2",
     "dotenv": "^8.0.0",
     "https-proxy-agent": "^2.2.1",
+    "husky": "^4.3.0",
     "jasmine-core": "~3.4.0",
     "jasmine-spec-reporter": "~4.2.1",
     "karma": "~4.1.0",
     "karma-chrome-launcher": "~2.2.0",
-    "karma-firefox-launcher": "~1.3.0",
     "karma-coverage-istanbul-reporter": "~2.0.1",
+    "karma-firefox-launcher": "~1.3.0",
     "karma-jasmine": "~2.0.1",
     "karma-jasmine-html-reporter": "^1.4.0",
+    "lint-staged": "^10.4.0",

Review comment:
       Because code formatter is only used in the development stage. In production, we do not need to run formatter. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [submarine] kevin85421 commented on pull request #426: SUBMARINE-652. Autoformat staged files before committing

Posted by GitBox <gi...@apache.org>.
kevin85421 commented on pull request #426:
URL: https://github.com/apache/submarine/pull/426#issuecomment-703196031


   LGTM


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [submarine] asfgit closed pull request #426: SUBMARINE-652. Autoformat staged files before committing

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #426:
URL: https://github.com/apache/submarine/pull/426


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [submarine] kevin85421 commented on a change in pull request #426: SUBMARINE-652. Autoformat staged files before committing

Posted by GitBox <gi...@apache.org>.
kevin85421 commented on a change in pull request #426:
URL: https://github.com/apache/submarine/pull/426#discussion_r499135115



##########
File path: submarine-workbench/workbench-web-ng/package.json
##########
@@ -49,14 +53,16 @@
     "codelyzer": "^5.1.2",
     "dotenv": "^8.0.0",
     "https-proxy-agent": "^2.2.1",
+    "husky": "^4.3.0",
     "jasmine-core": "~3.4.0",
     "jasmine-spec-reporter": "~4.2.1",
     "karma": "~4.1.0",
     "karma-chrome-launcher": "~2.2.0",
-    "karma-firefox-launcher": "~1.3.0",
     "karma-coverage-istanbul-reporter": "~2.0.1",
+    "karma-firefox-launcher": "~1.3.0",
     "karma-jasmine": "~2.0.1",
     "karma-jasmine-html-reporter": "^1.4.0",
+    "lint-staged": "^10.4.0",

Review comment:
       Thank you for your contribution! I am wondering why we need to remove "lint-staged" from "dependencies" and add it to "devDependencies"?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [submarine] ByronHsu commented on a change in pull request #426: SUBMARINE-652. Autoformat staged files before committing

Posted by GitBox <gi...@apache.org>.
ByronHsu commented on a change in pull request #426:
URL: https://github.com/apache/submarine/pull/426#discussion_r499135626



##########
File path: submarine-workbench/workbench-web-ng/package.json
##########
@@ -49,14 +53,16 @@
     "codelyzer": "^5.1.2",
     "dotenv": "^8.0.0",
     "https-proxy-agent": "^2.2.1",
+    "husky": "^4.3.0",
     "jasmine-core": "~3.4.0",
     "jasmine-spec-reporter": "~4.2.1",
     "karma": "~4.1.0",
     "karma-chrome-launcher": "~2.2.0",
-    "karma-firefox-launcher": "~1.3.0",
     "karma-coverage-istanbul-reporter": "~2.0.1",
+    "karma-firefox-launcher": "~1.3.0",
     "karma-jasmine": "~2.0.1",
     "karma-jasmine-html-reporter": "^1.4.0",
+    "lint-staged": "^10.4.0",

Review comment:
       lint-staged is a package by which you can some check (in here, is prettier) to staged files.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org