You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by remcohaszing <gi...@git.apache.org> on 2017/05/16 08:04:28 UTC

[GitHub] cordova-lib pull request #558: CB-12766 Consistently write JSON with 2 space...

GitHub user remcohaszing opened a pull request:

    https://github.com/apache/cordova-lib/pull/558

    CB-12766 Consistently write JSON with 2 spaces indentation

    ### Platforms affected
    None really.
    
    ### What does this PR do?
    JSON was written with 4 spaces indentation and even a tab at some
    point. Most NodeJS tools write their JSON configuration with an
    indentation of 2 spaces. Most notably npm does this, which writes to
    package.json, as does Cordova. This caused unnecessary changes in
    package.json.
    
    ### What testing has been done on this change?
    None, this is mostly stylistic.
    
    ### Checklist
    - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
    - [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
    - [x] Added automated test coverage as appropriate for this change.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/remcohaszing/cordova-lib master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-lib/pull/558.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #558
    
----
commit 7431e36fee775f0383ad3c3dae396a2a95c4bc05
Author: Remco Haszing <re...@gmail.com>
Date:   2017-05-16T07:58:54Z

    CB-12766 Consistently write JSON with 2 spaces indentation
    
    JSON was written with 4 spaces indentation and even a tab at some
    point. Most NodeJS tools write their JSON configuration with an
    indentation of 2 spaces. Most notably npm does this, which writes to
    package.json, as does Cordova. This caused unnecessary changes in
    package.json.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by stevengill <gi...@git.apache.org>.
Github user stevengill commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    @uloco want to add your comment to this issue: https://issues.apache.org/jira/browse/CB-12810


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by jcesarmobile <gi...@git.apache.org>.
Github user jcesarmobile commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    There is also https://issues.apache.org/jira/browse/CB-13009, they are similar, not sure if duplicated


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by alexreg <gi...@git.apache.org>.
Github user alexreg commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    Surely the whitespace settings should simply be maintained, like NPM/Yarn does? i.e. if it's already using tabs, keep tabs, and keep the number of spaces being used.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    +1, let's merge this.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by funkyvisions <gi...@git.apache.org>.
Github user funkyvisions commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    I don't like that my original package.json and config.xml get overwritten.  I manage them myself and have lots of comments in them to detail intricacies.  I also group things together so that they make logical sense for me.  How can I get cordova to not touch these files?  I tried --nosave on prepare and "cordova config set autosave false".  Let me know if there is a better place we can have this discussion.  This is the only thread I found regarding the overwriting of the configuration files.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib pull request #558: CB-12766 Consistently write JSON with 2 space...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-lib/pull/558


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by stevengill <gi...@git.apache.org>.
Github user stevengill commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    Hey @G-Rath 
    
    CB-12810 is very much still open :). https://issues.apache.org/jira/browse/CB-12810
    
    Thanks for your comment. This is something we will hopefully get to soon.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by stevengill <gi...@git.apache.org>.
Github user stevengill commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    merged


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by G-Rath <gi...@git.apache.org>.
Github user G-Rath commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    @stevengill I really agree with @uloco - Not only for the reason of consistent, but because the constant removal of the last line is picked up by VCSs, which can be really annoying. 
    
    While you've attached uloco's comment to CB-12810, I've noticed that it's been marked as fixed. 
    
    Because of the way the new line removal effects VCSs, I'd consider this a bug (even if a minor one).
    
    While I'm happy to (and normally would just) file a bug report, since you've already commented on it, and there is technically an issue already for it, can I leave it in your hands to make sure this gets considered?
    
    Thanks :)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by uloco <gi...@git.apache.org>.
Github user uloco commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    @stevengill Go for it. I don't have an account there...


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by janpio <gi...@git.apache.org>.
Github user janpio commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    @funkyvisions You might want to create a new issue for that instead of commenting on old ones.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by uloco <gi...@git.apache.org>.
Github user uloco commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    When adding platforms or plugins, you also perform a config.xml rewrite. Will this merge affect config.xml indentation rewrites, too? I do use 2 space indentation everywhere. It would be nice if you could just get the default indentation for the file and use the present one. Is this possible or worked on anywhere else?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by remcohaszing <gi...@git.apache.org>.
Github user remcohaszing commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    @piotrowski I did a regex replace to replace all occurrences of `JSON.stringify`, so basically this affects all JSON files that are modified by Cordova.
    
    I think this is a pretty complete list of the files affected:
    
    - *.cordova/config.json*
    - *plugins/fetch.json*
    - *plugins/[platform].json*
    - *package.json*


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by stevengill <gi...@git.apache.org>.
Github user stevengill commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    here is an existing issue https://issues.apache.org/jira/browse/CB-12810


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by mraerino <gi...@git.apache.org>.
Github user mraerino commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    Is this going to be merged?
    The current behavior really messes up my workflow.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by piotrowski <gi...@git.apache.org>.
Github user piotrowski commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    Which files will this affect?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: [GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...,

Posted by Giorgio Natili <g...@2xe.io>.
,,

On Tue, May 16, 2017 at 12:20 PM stevengill <gi...@git.apache.org> wrote:

> Github user stevengill commented on the issue:
>
>     https://github.com/apache/cordova-lib/pull/558
>
>     really good point. We should switch to two like npm.
>
>
> ---
> 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 infrastructure@apache.org or file a JIRA ticket
> with INFRA.
> ---
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
> --
Sorry for the brevity, Sent from Gmail Mobile

[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by stevengill <gi...@git.apache.org>.
Github user stevengill commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    really good point. We should switch to two like npm. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-lib issue #558: CB-12766 Consistently write JSON with 2 spaces inden...

Posted by uloco <gi...@git.apache.org>.
Github user uloco commented on the issue:

    https://github.com/apache/cordova-lib/pull/558
  
    You should also keep the last line if it's empty in both, `package.json` and `config.xml`.
    The [POSIX standard](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206) defines a line like this:
    
    > 3.206 Line
    > A sequence of zero or more non- <newline> characters plus a terminating <newline> character.
    
    A lot of us are developing on UNIX systems and are following this practice. It would be nice, if you could help us keeping it consistent.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org