[GitHub] zeppelin issue #1168: [MINOR] Add formatter
Github user bzz commented on the issue: https://github.com/apache/zeppelin/pull/1168 I think we are already on the path of multiple PRs, wich sounds great to me! @jongyoul shall we close this guy then? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] zeppelin issue #1168: [MINOR] Add formatter
Github user 1ambda commented on the issue: https://github.com/apache/zeppelin/pull/1168 @bzz I created a JIRA issue for this: https://issues.apache.org/jira/browse/ZEPPELIN-1709 We can resolve this in 1 PR or can split it into multiples. I think we can resolve these things - update checkstyle.xml - update maven plugin or introduce more recent a new plugin https://github.com/checkstyle/checkstyle (some apache projects use both) - write a detailed guide about how to format your zeppelin code while making contribution --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] zeppelin issue #1168: [MINOR] Add formatter
Github user bzz commented on the issue: https://github.com/apache/zeppelin/pull/1168 @jongyoul how do you think, could you interactively rebase this branch to have only `./_tools/*` changes? Or is it better to start a JIRA issue and close this guy? @1ambda do you know any way of getting cross-ide formatters, consistent with checkstyle rules for the [Java style guide](https://google.github.io/styleguide/javaguide.html)? Should we just try bringin in: - eclipse https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml - intelij https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml and - https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml here and then see if they produce same results re-formatting a single class? What do you guys think? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] zeppelin issue #1168: [MINOR] Add formatter
Github user jongyoul commented on the issue: https://github.com/apache/zeppelin/pull/1168 @bzz Yes, I also don't think it's good idea to reformat all of codes. I like your suggestion to adopt IDE formatter first. Let's find a way to sync both of IntelliJ and Eclipse formatters. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] zeppelin issue #1168: [MINOR] Add formatter
Github user bzz commented on the issue: https://github.com/apache/zeppelin/pull/1168 Got it. Let's may be change PR title to WIP or even may be close it for now but keep the branch and create a dedicated JIRA issue and link this work there? It's a bigger effort that we initially think, so we can add sub-tasts like - InteliJ formatter - Eclipse formatter - Build time check of the code conventions to conform our styleguide One problem that I can see though - it will be not very useful commit, retrofitting whole codebase to the styleguilde: it will touch all the files in the project and just re-formatting it. This complicates navigating the history of changes and makes 'git blame' less useful. What would be great if we could provide consistent formatters for IDEs first, advise everyone to use them AND then make mandatory style checks ONLY for the new code. I think this should be possible! I can look into that. But we still need 2 consistent formatters. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] zeppelin issue #1168: [MINOR] Add formatter
Github user jongyoul commented on the issue: https://github.com/apache/zeppelin/pull/1168 checkstyle in my PR is too strict and if we push it, too many error occurs while checking style. I don't know how to handle with it. What do you think of it? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] zeppelin issue #1168: [MINOR] Add formatter
Github user bzz commented on the issue: https://github.com/apache/zeppelin/pull/1168 Sounds good! Let's rebase on master and make CI happy again first? :) --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] zeppelin issue #1168: [MINOR] Add formatter
Github user jongyoul commented on the issue: https://github.com/apache/zeppelin/pull/1168 @bzz Sure, I agree. it's kind of separate issue. I think enforcing code format at first supporting formatter later would be a good plan. How about you? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] zeppelin issue #1168: [MINOR] Add formatter
Github user bzz commented on the issue: https://github.com/apache/zeppelin/pull/1168 Do you think we should merge it as is and address eclipse formatter in the separate issue? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] zeppelin issue #1168: [MINOR] Add formatter
Github user bzz commented on the issue: https://github.com/apache/zeppelin/pull/1168 Yes, I think it's good idea on having stricter checkstyle. Let me know if you want me to try again! --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] zeppelin issue #1168: [MINOR] Add formatter
Github user jongyoul commented on the issue: https://github.com/apache/zeppelin/pull/1168 @bzz I've found Intellij doesn't export all of some configurations. We need to enforce the format by configuring checkstyle.xml. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] zeppelin issue #1168: [MINOR] Add formatter
Github user jongyoul commented on the issue: https://github.com/apache/zeppelin/pull/1168 @bzz Thanks for the suggestion. I think we need to update docs and it's time to install Eclipse by myself in order to check the difference between Eclipse and Intellij. Thanks Alex. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] zeppelin issue #1168: [MINOR] Add formatter
Github user bzz commented on the issue: https://github.com/apache/zeppelin/pull/1168 I have applied `ZeppelinStyle` Java formatter in Eclipse and re-formatted `ZeppelinServer.java` here is the diff below ``` diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java b/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java index 4ef6f44..686d6ea 100644 --- a/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java +++ b/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java @@ -1,18 +1,16 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - *http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. */ package org.apache.zeppelin.server; @@ -105,8 +103,9 @@ public class ZeppelinServer extends Application { this.notebookIndex = new LuceneSearch(); this.notebookAuthorization = new NotebookAuthorization(conf); this.credentials = new Credentials(conf.credentialsPersist(), conf.getCredentialsPath()); -notebook = new Notebook(conf, notebookRepo, schedulerFactory, replFactory, notebookWsServer, -notebookIndex, notebookAuthorization, credentials); +notebook = +new Notebook(conf, notebookRepo, schedulerFactory, replFactory, notebookWsServer, +notebookIndex, notebookAuthorization, credentials); // to update notebook from application event from remote process. heliumApplicationFactory.setNotebook(notebook); @@ -135,12 +134,12 @@ public class ZeppelinServer extends Application { // Notebook server setupNotebookServer(webApp, conf); -//Below is commented since zeppelin-docs module is removed. -//final WebAppContext webAppSwagg = setupWebAppSwagger(conf); +// Below is commented since zeppelin-docs module is removed. +// final WebAppContext webAppSwagg = setupWebAppSwagger(conf); LOG.info("Starting zeppelin server"); try { - jettyWebServer.start(); //Instantiates ZeppelinServer + jettyWebServer.start(); // Instantiates ZeppelinServer } catch (Exception e) { LOG.error("Error while running jettyServer", e); System.exit(-1); @@ -148,7 +147,8 @@ public class ZeppelinServer extends Application { LOG.info("Done, zeppelin server started"); Runtime.getRuntime().addShutdownHook(new Thread() { - @Override public void run() { + @Override + public void run() { LOG.info("Shutting down Zeppelin Server ... "); try { jettyWebServer.stop(); @@ -192,13 +192,13 @@ public class ZeppelinServer extends Application { HttpConfiguration httpsConfig = new HttpConfiguration(httpConfig); SecureRequestCustomizer src = new SecureRequestCustomizer(); // Only with Jetty 9.3.x - // src.setStsMaxAge(2000); - // src.setStsIncludeSubDomains(true); + // src.setStsMaxAge(2000); + // src.setStsIncludeSubDomains(true); httpsConfig.addCustomizer(src); - connector = new ServerConnector(server, - new SslConnectionFactory(getSslContextFactory(conf), HttpVersion.HTTP_1_1.
[GitHub] zeppelin issue #1168: [MINOR] Add formatter
Github user bzz commented on the issue: https://github.com/apache/zeppelin/pull/1168 @jongyoul do you think we should update our documentation for contributors, mentioning this IDE setup as well? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] zeppelin issue #1168: [MINOR] Add formatter
Github user jongyoul commented on the issue: https://github.com/apache/zeppelin/pull/1168 Ready to review. Could you please check Eclipse's one? Open ZeppelinServer.java and reformat it and check if something's different or not. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---