You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/04/16 19:18:46 UTC

[GitHub] [incubator-pinot] mqliang opened a new pull request #6807: Add eclipse formatter in maven spotless plugin

mqliang opened a new pull request #6807:
URL: https://github.com/apache/incubator-pinot/pull/6807


   ## Description
   <!-- Add a description of your PR here.
   A good description should include pointers to an issue or design document, etc.
   -->
   
   Add eclipse formatter in maven spotless plugin. "org.eclipse.jdt.core.compiler.source" should be set as 1.8 otherwise spotless plugin will panic.
   
   cc @Jackie-Jiang @fx19880617 
   
   ## Upgrade Notes
   Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)
   * [ ] Yes (Please label as **<code>backward-incompat</code>**, and complete the section below on Release Notes)
   
   Does this PR fix a zero-downtime upgrade introduced earlier?
   * [ ] Yes (Please label this as **<code>backward-incompat</code>**, and complete the section below on Release Notes)
   
   Does this PR otherwise need attention when creating release notes? Things to consider:
   - New configuration options
   - Deprecation of configurations
   - Signature changes to public methods/interfaces
   - New plugins added or old plugins removed
   * [ ] Yes (Please label this PR as **<code>release-notes</code>** and complete the section on Release Notes)
   ## Release Notes
   <!-- If you have tagged this as either backward-incompat or release-notes,
   you MUST add text here that you would like to see appear in release notes of the
   next release. -->
   
   <!-- If you have a series of commits adding or enabling a feature, then
   add this section only in final commit that marks the feature completed.
   Refer to earlier release notes to see examples of text.
   -->
   ## Documentation
   <!-- If you have introduced a new feature or configuration, please add it to the documentation as well.
   See https://docs.pinot.apache.org/developers/developers-and-contributors/update-document
   -->
   


-- 
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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] codecov-commenter commented on pull request #6807: Add eclipse formatter in maven spotless plugin

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #6807:
URL: https://github.com/apache/incubator-pinot/pull/6807#issuecomment-821530371


   # [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6807?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#6807](https://codecov.io/gh/apache/incubator-pinot/pull/6807?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (184089b) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/cb9889bcc6a9c93c0e6f39d828e883aefaeaa318?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (cb9889b) will **decrease** coverage by `7.92%`.
   > The diff coverage is `65.03%`.
   
   > :exclamation: Current head 184089b differs from pull request most recent head ad61432. Consider uploading reports for the commit ad61432 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/6807/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-pinot/pull/6807?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #6807      +/-   ##
   ============================================
   - Coverage     74.00%   66.08%   -7.93%     
     Complexity       12       12              
   ============================================
     Files          1414     1414              
     Lines         68886    68639     -247     
     Branches       9942     9935       -7     
   ============================================
   - Hits          50979    45360    -5619     
   - Misses        14569    20048    +5479     
   + Partials       3338     3231     -107     
   ```
   
   | Flag | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | integration | `?` | `?` | |
   | unittests | `66.08% <65.03%> (+0.09%)` | `12.00 <0.00> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/6807?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...org/apache/pinot/broker/api/RequestStatistics.java](https://codecov.io/gh/apache/incubator-pinot/pull/6807/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYXBpL1JlcXVlc3RTdGF0aXN0aWNzLmphdmE=) | `44.11% <0.00%> (-21.04%)` | `0.00 <0.00> (ø)` | |
   | [...e/pinot/broker/api/resources/PinotBrokerDebug.java](https://codecov.io/gh/apache/incubator-pinot/pull/6807/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYXBpL3Jlc291cmNlcy9QaW5vdEJyb2tlckRlYnVnLmphdmE=) | `0.00% <ø> (-76.48%)` | `0.00 <0.00> (ø)` | |
   | [...t/broker/api/resources/PinotBrokerHealthCheck.java](https://codecov.io/gh/apache/incubator-pinot/pull/6807/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYXBpL3Jlc291cmNlcy9QaW5vdEJyb2tlckhlYWx0aENoZWNrLmphdmE=) | `0.00% <ø> (ø)` | `0.00 <0.00> (ø)` | |
   | [...pinot/broker/api/resources/PinotBrokerRouting.java](https://codecov.io/gh/apache/incubator-pinot/pull/6807/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYXBpL3Jlc291cmNlcy9QaW5vdEJyb2tlclJvdXRpbmcuamF2YQ==) | `0.00% <ø> (ø)` | `0.00 <0.00> (ø)` | |
   | [...pinot/broker/api/resources/PinotClientRequest.java](https://codecov.io/gh/apache/incubator-pinot/pull/6807/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYXBpL3Jlc291cmNlcy9QaW5vdENsaWVudFJlcXVlc3QuamF2YQ==) | `0.00% <0.00%> (-34.43%)` | `0.00 <0.00> (ø)` | |
   | [...not/broker/broker/helix/ClusterChangeMediator.java](https://codecov.io/gh/apache/incubator-pinot/pull/6807/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvYnJva2VyL2hlbGl4L0NsdXN0ZXJDaGFuZ2VNZWRpYXRvci5qYXZh) | `73.62% <ø> (-1.10%)` | `0.00 <0.00> (ø)` | |
   | [...che/pinot/broker/queryquota/MaxHitRateTracker.java](https://codecov.io/gh/apache/incubator-pinot/pull/6807/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcXVlcnlxdW90YS9NYXhIaXRSYXRlVHJhY2tlci5qYXZh) | `95.45% <ø> (ø)` | `0.00 <0.00> (ø)` | |
   | [...thandler/SingleConnectionBrokerRequestHandler.java](https://codecov.io/gh/apache/incubator-pinot/pull/6807/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcmVxdWVzdGhhbmRsZXIvU2luZ2xlQ29ubmVjdGlvbkJyb2tlclJlcXVlc3RIYW5kbGVyLmphdmE=) | `12.76% <0.00%> (-72.66%)` | `0.00 <0.00> (ø)` | |
   | [...outing/segmentselector/SegmentSelectorFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/6807/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtYnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9icm9rZXIvcm91dGluZy9zZWdtZW50c2VsZWN0b3IvU2VnbWVudFNlbGVjdG9yRmFjdG9yeS5qYXZh) | `60.00% <ø> (ø)` | `0.00 <0.00> (ø)` | |
   | [.../main/java/org/apache/pinot/client/Connection.java](https://codecov.io/gh/apache/incubator-pinot/pull/6807/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Nvbm5lY3Rpb24uamF2YQ==) | `36.36% <0.00%> (-8.09%)` | `0.00 <0.00> (ø)` | |
   | ... and [851 more](https://codecov.io/gh/apache/incubator-pinot/pull/6807/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6807?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/6807?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [cb9889b...ad61432](https://codecov.io/gh/apache/incubator-pinot/pull/6807?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] mqliang edited a comment on pull request #6807: Add eclipse formatter in maven spotless plugin

Posted by GitBox <gi...@apache.org>.
mqliang edited a comment on pull request #6807:
URL: https://github.com/apache/incubator-pinot/pull/6807#issuecomment-821780315


   @Jackie-Jiang 
   > Change the eclipse format to follow the current intellij format as much as possible (e.g. new line for exception, new space for array declaration etc.). We should not see almost all files reformatted
   
   For "new line for exception", in Intellj, it's corresponding option is called "always wrap throws keyword":
   ![Jietu20210416-234504](https://user-images.githubusercontent.com/12423751/115104530-ee84bd80-9f0d-11eb-816a-c584dec50b81.jpg)
   
   Unfortunately, Eclipse formatter does not has such a option, here is a complete list of Eclipse formatter options: https://github.com/eclipse/eclipse.jdt.core/blob/7e35bbd8b9cc36a449e562c61841f9968ec4bec3/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java#L122-L524
   
   For `new space for array declaration etc`, I have change the codestyle-eclipse.xml file to match IntellJ behavior.
   
   So, it's almost impossible to make the maven plugin be consistent with IntellJ behavior if we use eclipse formatter given that IntellJ/Eclipse provide different options. 
   
   If we wanner keep consistency across IntellJ IDE, Eclipse IDE and maven plugin, the only choice is [the google formatter](https://github.com/google/google-java-format), which has plugin for both IntellJ/Eclipse/Maven.
   
   The drawback is:
   * the tool enforces [Google Java style guide](https://google.github.io/styleguide/javaguide.html), which was [praised and recommended by the Oracle Java team as described in the Oracle Java magazine](https://alanzeichick.com/2016/11/wheres-best-java-coding-style-guide-not-oracle.html) though, the tool itself does not allow too much config by design. Copied form
   google-java-format project home page:
   ```
   Note: There is no configurability as to the formatter's algorithm for formatting. This is a deliberate design decision to unify 
   our code formatting on a single format.
   ```
   * The tool will mess up license header, see: https://github.com/diffplug/spotless/issues/843. Let's wait for reply from spotless team, it's impossible to be used for pinot if there is no solution/workaround.


-- 
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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] mqliang commented on pull request #6807: Add eclipse formatter in maven spotless plugin

Posted by GitBox <gi...@apache.org>.
mqliang commented on pull request #6807:
URL: https://github.com/apache/incubator-pinot/pull/6807#issuecomment-821780315


   @Jackie-Jiang 
   > Change the eclipse format to follow the current intellij format as much as possible (e.g. new line for exception, new space for array declaration etc.). We should not see almost all files reformatted
   
   Unfortunately, for "new line for exception", in Intellj, it's corresponding option is called "always wrap throws keyword":
   ![Jietu20210416-234504](https://user-images.githubusercontent.com/12423751/115104530-ee84bd80-9f0d-11eb-816a-c584dec50b81.jpg)
   
   Eclipse formatter does not has such a option, here is a complete list of Eclipse formatter options: https://github.com/eclipse/eclipse.jdt.core/blob/7e35bbd8b9cc36a449e562c61841f9968ec4bec3/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java#L122-L524
   
   For `new space for array declaration etc`, I have change the codestyle-eclipse.xml file to match IntellJ behavior.
   
   So, it's almost impossible to make the maven plugin be consistent with IntellJ behavior if we use eclipse formatter given that IntellJ/Eclipse provide different options. 
   
   If we wanner keep consistency across IntellJ IDE, Eclipse IDE and maven plugin, the only choice is [the google formatter](https://github.com/google/google-java-format), which has plugin for both IntellJ/Eclipse/Maven.
   
   The drawback is:
   * the tool enforces [Google Java style guide](https://google.github.io/styleguide/javaguide.html), which was [praised and recommended by the Oracle Java team as described in the Oracle Java magazine](https://alanzeichick.com/2016/11/wheres-best-java-coding-style-guide-not-oracle.html) though, the tool itself does not allow too much config by design. Copied form
   google-java-format project home page:
   ```
   Note: There is no configurability as to the formatter's algorithm for formatting. This is a deliberate design decision to unify 
   our code formatting on a single format.
   ```
   * The tool will mess up license header, see: https://github.com/diffplug/spotless/issues/843. If there is no solution/workaround, it's impossible to be used for pinot.


-- 
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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] mqliang edited a comment on pull request #6807: Add eclipse formatter in maven spotless plugin

Posted by GitBox <gi...@apache.org>.
mqliang edited a comment on pull request #6807:
URL: https://github.com/apache/incubator-pinot/pull/6807#issuecomment-821780315


   @Jackie-Jiang 
   > Change the eclipse format to follow the current intellij format as much as possible (e.g. new line for exception, new space for array declaration etc.). We should not see almost all files reformatted
   
   For "new line for exception", in Intellj, it's corresponding option is called "always wrap throws keyword":
   ![Jietu20210416-234504](https://user-images.githubusercontent.com/12423751/115104530-ee84bd80-9f0d-11eb-816a-c584dec50b81.jpg)
   
   Unfortunately, Eclipse formatter does not has such a option, here is a complete list of Eclipse formatter options: https://github.com/eclipse/eclipse.jdt.core/blob/7e35bbd8b9cc36a449e562c61841f9968ec4bec3/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java#L122-L524
   
   For `new space for array declaration etc`, I have change the codestyle-eclipse.xml file to match IntellJ behavior.
   
   So, it's almost impossible to make the maven plugin be consistent with IntellJ behavior if we use eclipse formatter given that IntellJ/Eclipse provide different options. 
   
   If we wanner keep consistency across IntellJ IDE, Eclipse IDE and maven plugin, the only choice is [the google formatter](https://github.com/google/google-java-format), which has plugin for both IntellJ/Eclipse/Maven.
   
   The drawback is:
   * the tool enforces [Google Java style guide](https://google.github.io/styleguide/javaguide.html), which was [praised and recommended by the Oracle Java team as described in the Oracle Java magazine](https://alanzeichick.com/2016/11/wheres-best-java-coding-style-guide-not-oracle.html) though, the tool itself does not allow too much config by design. Copied form
   google-java-format project home page:
   ```
   Note: There is no configurability as to the formatter's algorithm for formatting. This is a deliberate design decision to unify 
   our code formatting on a single format.
   ```
   * The tool will mess up license header, see: https://github.com/diffplug/spotless/issues/843. If there is no solution/workaround, it's impossible to be used for pinot.


-- 
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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #6807: Add eclipse formatter in maven spotless plugin

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #6807:
URL: https://github.com/apache/incubator-pinot/pull/6807#discussion_r616157229



##########
File path: pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/HelixBrokerStarter.java
##########
@@ -130,6 +128,19 @@ public HelixBrokerStarter(PinotConfiguration brokerConf, String clusterName, Str
     _brokerConf.addProperty(Broker.CONFIG_OF_BROKER_ID, _brokerId);
   }
 
+  public static HelixBrokerStarter getDefault() throws Exception {

Review comment:
       Can we change the formatter to not force the order of the methods?




-- 
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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] mqliang edited a comment on pull request #6807: Add eclipse formatter in maven spotless plugin

Posted by GitBox <gi...@apache.org>.
mqliang edited a comment on pull request #6807:
URL: https://github.com/apache/incubator-pinot/pull/6807#issuecomment-821578169


   > A lot of changes are not in sync with the intellij format. I think most of the developpers are using intellij to format the code. Let's try to make the plug-in the same behavior as auto-formatting with intellij
   
   The level of difficulty is extremely high:
   * Intellj is not an open source project, the formatter it used is built-in, so there is no intelllj-formater maven plugin. Which means we can not use intellj-code-style.xml directly.
   * The inability to work out a set of eclipse formatting rules that are equivalent to what we use in IntelliJ basically prevents us from using the eclipse plugin (the one we use in this PR). 
   * IntelliJ can import eclipse code styles, but translation is not accurate enough, and the opposite direction is not supported. Imtellj can not export formatting rules as eclipse formatting rules neither. So we are unable to generate eclipse rules in an automatic way.
   
   So, what we can do is either:
   * Keep the import order and unused imports removal check we made in https://github.com/apache/incubator-pinot/pull/6782, but give up the code block auto-formatting. Let engineer manually format the file (github workflow can only detect violation at the imports section, code-block part violation can not be detected).
   
   Or 
   
   * Forget about the IDE formatting, engineer don't need to manually format the file using IDE, but manually run `mvn spotless:format` to format (github workflow will fail and prompt engineer to run `mvn spotless:format`  if there are any violations). 
   
   Option 2 can force the whole codebase formatted in a consistent way, but not match the intellij auto-formatting behavior.


-- 
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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] Jackie-Jiang commented on pull request #6807: Add eclipse formatter in maven spotless plugin

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on pull request #6807:
URL: https://github.com/apache/incubator-pinot/pull/6807#issuecomment-821739796


   @mqliang
   I would suggest doing the followings:
   1. Change the eclipse format to follow the current intellij format as much as possible (e.g. new line for exception, new space for array declaration etc.). We should not see almost all files reformatted
   2. Reformat the code base using the plug-in
   3. Remove the intellij format and always stick with the eclipse format
   4. Update the `Code Setup` page: https://docs.pinot.apache.org/developers/developers-and-contributors/code-setup


-- 
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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] mqliang commented on pull request #6807: Add eclipse formatter in maven spotless plugin

Posted by GitBox <gi...@apache.org>.
mqliang commented on pull request #6807:
URL: https://github.com/apache/incubator-pinot/pull/6807#issuecomment-821578169


   > A lot of changes are not in sync with the intellij format. I think most of the developpers are using intellij to format the code. Let's try to make the plug-in the same behavior as auto-formatting with intellij
   
   The level of difficulty is extremely high:
   * Intellj is not an open source project, the formatter it used is built-in, so there is no intelllj-formater maven plugin. Which means we can not use intellj-code-style.xml directly.
   * The inability to work out a set of eclipse formatting rules that are equivalent to what we use in IntelliJ basically prevents us from using the eclipse plugin (the one we use in this PR). 
   * IntelliJ can import eclipse code styles, but translation is not accurate enough, and the opposite direction is not supported. Imtellj can not export formatting rules as eclipse formatting rules neither. So we are unable to generate eclipse rules in an automatic way.
   
   So, what we can do is either:
   * Keep the import order and unused imports removal check we made in https://github.com/apache/incubator-pinot/pull/6782, but give up the code block auto-formatting. Let engineer manually format the file (github workflow can only detect violation at the imports section, code-block part violation can not be detected).
   
   Or 
   
   * Forget about the IDE formatting, engineer don't need to manually format the file using IDE, but manually run `mvn spotless:format` to format (github workflow will fail and prompt engineer to run `mvn spotless:format`  if there are any violations). 
   
   Option 2 can force the whole codebase formatted in an consistency way, but not match the intellij auto-formatting behavior.


-- 
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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org