[JBoss JIRA] (ROASTER-131) Config file not applied when using CLI
by George Gastaldi (Jira)
[ https://issues.jboss.org/browse/ROASTER-131?page=com.atlassian.jira.plugi... ]
George Gastaldi closed ROASTER-131.
-----------------------------------
Resolution: Done
> Config file not applied when using CLI
> --------------------------------------
>
> Key: ROASTER-131
> URL: https://issues.jboss.org/browse/ROASTER-131
> Project: Roaster
> Issue Type: Enhancement
> Reporter: Gunnar Morling
> Assignee: George Gastaldi
> Priority: Major
> Fix For: 2.20.8.Final, 2.20.7.Final
>
>
> I'm using the CLI (roaster.sh) to format some source files, but it doesn't apply the given Eclipse formatter file (passed via -c). As per roaster's output it should have worked, but clearly it's using a different configuration, e.g. in my XML config file I'm mandating to only use spaces for indentation, whereas the file is indented with tabs after roaster ran. Note the config itself can't be the problem, as it's applied as expected when ran through Spotless.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 7 months
[JBoss JIRA] (ROASTER-131) Config file not applied when using CLI
by George Gastaldi (Jira)
[ https://issues.jboss.org/browse/ROASTER-131?page=com.atlassian.jira.plugi... ]
George Gastaldi commented on ROASTER-131:
-----------------------------------------
I tried to find something in the API that would give more information, but failed to find it :(
This is the place where the formatting happens: https://github.com/forge/roaster/blob/master/impl/src/main/java/org/jboss... (if it fails, it returns a null {{TextEdit}} unfortunately)
I'll release 2.20.8.Final and close this issue afterwards.
Thanks!
> Config file not applied when using CLI
> --------------------------------------
>
> Key: ROASTER-131
> URL: https://issues.jboss.org/browse/ROASTER-131
> Project: Roaster
> Issue Type: Enhancement
> Reporter: Gunnar Morling
> Assignee: George Gastaldi
> Priority: Major
> Fix For: 2.20.7.Final, 2.20.8.Final
>
>
> I'm using the CLI (roaster.sh) to format some source files, but it doesn't apply the given Eclipse formatter file (passed via -c). As per roaster's output it should have worked, but clearly it's using a different configuration, e.g. in my XML config file I'm mandating to only use spaces for indentation, whereas the file is indented with tabs after roaster ran. Note the config itself can't be the problem, as it's applied as expected when ran through Spotless.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 7 months
[JBoss JIRA] (ROASTER-131) Config file not applied when using CLI
by Gunnar Morling (Jira)
[ https://issues.jboss.org/browse/ROASTER-131?page=com.atlassian.jira.plugi... ]
Gunnar Morling commented on ROASTER-131:
----------------------------------------
[~gastaldi], tested it and can confirm it works, very nice! About the failure reporting, tested that, too, and it fails sa expected when enforcing an old language level and using newer constructs. Any chance though to extract some more context about the exact reason from the JDT formatter? The current message ("The source cannot be formatted") is rather generic, so hard to act on it. In any case I'd love a new release based on the current master, as it will allow me to make Roaster part of my workflow, sharing one single formatter config between the IDE, Spotless and a shell script for formatting changed files (might even make that a pre-commit hook). I'm also planning to blog about this set-up, as it [sparked some interest|https://twitter.com/gunnarmorling/status/1086265577835032577].
> Config file not applied when using CLI
> --------------------------------------
>
> Key: ROASTER-131
> URL: https://issues.jboss.org/browse/ROASTER-131
> Project: Roaster
> Issue Type: Enhancement
> Reporter: Gunnar Morling
> Assignee: George Gastaldi
> Priority: Major
> Fix For: 2.20.7.Final, 2.20.8.Final
>
>
> I'm using the CLI (roaster.sh) to format some source files, but it doesn't apply the given Eclipse formatter file (passed via -c). As per roaster's output it should have worked, but clearly it's using a different configuration, e.g. in my XML config file I'm mandating to only use spaces for indentation, whereas the file is indented with tabs after roaster ran. Note the config itself can't be the problem, as it's applied as expected when ran through Spotless.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 7 months
[JBoss JIRA] (ROASTER-131) Config file not applied when using CLI
by George Gastaldi (Jira)
[ https://issues.jboss.org/browse/ROASTER-131?page=com.atlassian.jira.plugi... ]
George Gastaldi updated ROASTER-131:
------------------------------------
Fix Version/s: 2.20.8.Final
> Config file not applied when using CLI
> --------------------------------------
>
> Key: ROASTER-131
> URL: https://issues.jboss.org/browse/ROASTER-131
> Project: Roaster
> Issue Type: Enhancement
> Reporter: Gunnar Morling
> Assignee: George Gastaldi
> Priority: Major
> Fix For: 2.20.7.Final, 2.20.8.Final
>
>
> I'm using the CLI (roaster.sh) to format some source files, but it doesn't apply the given Eclipse formatter file (passed via -c). As per roaster's output it should have worked, but clearly it's using a different configuration, e.g. in my XML config file I'm mandating to only use spaces for indentation, whereas the file is indented with tabs after roaster ran. Note the config itself can't be the problem, as it's applied as expected when ran through Spotless.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 7 months
[JBoss JIRA] (ROASTER-131) Config file not applied when using CLI
by George Gastaldi (Jira)
[ https://issues.jboss.org/browse/ROASTER-131?page=com.atlassian.jira.plugi... ]
George Gastaldi commented on ROASTER-131:
-----------------------------------------
[~gunnar.morling],
I pushed a change to the master branch that may fix this issue. Can I ask you to give it a try?
Thanks!
> Config file not applied when using CLI
> --------------------------------------
>
> Key: ROASTER-131
> URL: https://issues.jboss.org/browse/ROASTER-131
> Project: Roaster
> Issue Type: Enhancement
> Reporter: Gunnar Morling
> Assignee: George Gastaldi
> Priority: Major
> Fix For: 2.20.7.Final
>
>
> I'm using the CLI (roaster.sh) to format some source files, but it doesn't apply the given Eclipse formatter file (passed via -c). As per roaster's output it should have worked, but clearly it's using a different configuration, e.g. in my XML config file I'm mandating to only use spaces for indentation, whereas the file is indented with tabs after roaster ran. Note the config itself can't be the problem, as it's applied as expected when ran through Spotless.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 7 months
[JBoss JIRA] (ROASTER-131) Config file not applied when using CLI
by Gunnar Morling (Jira)
[ https://issues.jboss.org/browse/ROASTER-131?page=com.atlassian.jira.plugi... ]
Gunnar Morling edited comment on ROASTER-131 at 1/21/19 6:55 AM:
-----------------------------------------------------------------
Hey [~gastaldi], I'm not totally sure what's the implication of
{quote}
(at least you get some default values that can be overriden by the configuration file).
{quote}
In any case, it should not be the expectation that the "org.eclipse.jdt.core.compiler.source" option is part of the XML configuration file. When exporting that file from the IDE, this option will not be contained. So if someone had added it manually, it will easily be missed when updating the file with a newly exported one.
was (Author: gunnar.morling):
Hey [~gastaldi], I'm not totally sure what's the implication of
{quote}
(at least you get some default values that can be overriden by the configuration file).
{quote}
In any case, it should not be the expectation that the "org.eclipse.jdt.core.compiler.source" is part of the XML configuration file. When exporting that file from the IDE, this option will not be contained. So if someone had added it manually, it will easily be missed when updating the file with a newly exported one.
> Config file not applied when using CLI
> --------------------------------------
>
> Key: ROASTER-131
> URL: https://issues.jboss.org/browse/ROASTER-131
> Project: Roaster
> Issue Type: Enhancement
> Reporter: Gunnar Morling
> Assignee: George Gastaldi
> Priority: Major
> Fix For: 2.20.7.Final
>
>
> I'm using the CLI (roaster.sh) to format some source files, but it doesn't apply the given Eclipse formatter file (passed via -c). As per roaster's output it should have worked, but clearly it's using a different configuration, e.g. in my XML config file I'm mandating to only use spaces for indentation, whereas the file is indented with tabs after roaster ran. Note the config itself can't be the problem, as it's applied as expected when ran through Spotless.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 7 months
[JBoss JIRA] (ROASTER-131) Config file not applied when using CLI
by Gunnar Morling (Jira)
[ https://issues.jboss.org/browse/ROASTER-131?page=com.atlassian.jira.plugi... ]
Gunnar Morling edited comment on ROASTER-131 at 1/21/19 6:55 AM:
-----------------------------------------------------------------
Hey [~gastaldi], I'm not totally sure what's the implication of
{quote}
(at least you get some default values that can be overriden by the configuration file).
{quote}
In any case, it should not be the expectation that the "org.eclipse.jdt.core.compiler.source" option is part of the XML configuration file. When exporting that file from the IDE, this option will not be contained. So if someone had added it manually before, it will easily be missed when updating the file with a newly exported one.
was (Author: gunnar.morling):
Hey [~gastaldi], I'm not totally sure what's the implication of
{quote}
(at least you get some default values that can be overriden by the configuration file).
{quote}
In any case, it should not be the expectation that the "org.eclipse.jdt.core.compiler.source" option is part of the XML configuration file. When exporting that file from the IDE, this option will not be contained. So if someone had added it manually, it will easily be missed when updating the file with a newly exported one.
> Config file not applied when using CLI
> --------------------------------------
>
> Key: ROASTER-131
> URL: https://issues.jboss.org/browse/ROASTER-131
> Project: Roaster
> Issue Type: Enhancement
> Reporter: Gunnar Morling
> Assignee: George Gastaldi
> Priority: Major
> Fix For: 2.20.7.Final
>
>
> I'm using the CLI (roaster.sh) to format some source files, but it doesn't apply the given Eclipse formatter file (passed via -c). As per roaster's output it should have worked, but clearly it's using a different configuration, e.g. in my XML config file I'm mandating to only use spaces for indentation, whereas the file is indented with tabs after roaster ran. Note the config itself can't be the problem, as it's applied as expected when ran through Spotless.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 7 months
[JBoss JIRA] (ROASTER-131) Config file not applied when using CLI
by Gunnar Morling (Jira)
[ https://issues.jboss.org/browse/ROASTER-131?page=com.atlassian.jira.plugi... ]
Gunnar Morling commented on ROASTER-131:
----------------------------------------
Hey [~gastaldi], I'm not totally sure what's the implication of
{quote}
(at least you get some default values that can be overriden by the configuration file).
{quote}
In any case, it should not be the expectation that the "org.eclipse.jdt.core.compiler.source" is part of the XML configuration file. When exporting that file from the IDE, this option will not be contained. So if someone had added it manually, it will easily be missed when updating the file with a newly exported one.
> Config file not applied when using CLI
> --------------------------------------
>
> Key: ROASTER-131
> URL: https://issues.jboss.org/browse/ROASTER-131
> Project: Roaster
> Issue Type: Enhancement
> Reporter: Gunnar Morling
> Assignee: George Gastaldi
> Priority: Major
> Fix For: 2.20.7.Final
>
>
> I'm using the CLI (roaster.sh) to format some source files, but it doesn't apply the given Eclipse formatter file (passed via -c). As per roaster's output it should have worked, but clearly it's using a different configuration, e.g. in my XML config file I'm mandating to only use spaces for indentation, whereas the file is indented with tabs after roaster ran. Note the config itself can't be the problem, as it's applied as expected when ran through Spotless.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 7 months
[JBoss JIRA] (ROASTER-131) Config file not applied when using CLI
by George Gastaldi (Jira)
[ https://issues.jboss.org/browse/ROASTER-131?page=com.atlassian.jira.plugi... ]
George Gastaldi commented on ROASTER-131:
-----------------------------------------
I think we could make this better by replacing the {{new Properties()}} call in the Formatter class with {{readConfigInternal()}} (at least you get some default values that can be overriden by the configuration file).
I like the idea of logging the failed formatting, I'll have a look at that too
> Config file not applied when using CLI
> --------------------------------------
>
> Key: ROASTER-131
> URL: https://issues.jboss.org/browse/ROASTER-131
> Project: Roaster
> Issue Type: Enhancement
> Reporter: Gunnar Morling
> Assignee: George Gastaldi
> Priority: Major
> Fix For: 2.20.7.Final
>
>
> I'm using the CLI (roaster.sh) to format some source files, but it doesn't apply the given Eclipse formatter file (passed via -c). As per roaster's output it should have worked, but clearly it's using a different configuration, e.g. in my XML config file I'm mandating to only use spaces for indentation, whereas the file is indented with tabs after roaster ran. Note the config itself can't be the problem, as it's applied as expected when ran through Spotless.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
6 years, 7 months