You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
add --ignore-space to ng init d (diff) command #2083
The aim is to avoid to lost a lot of time when migrating from angular-cli version to a new one only because there is a lot of diffs due to spacing (indentation of 2 or 4 spaces for example).
I suggest to add an --ignore-space option (or --ignore-diff-space) to the ng init command to resolve this issue.
@bougnat12@filipesilva
I have made a pull request to the jsdiff module, which is used to generate the diff. When that pull request is accepted I would gladly create a pull request to this repo to add the --ignore-space option.
Another option I would also suggest is --ignore-line-endings. That way the diff is more accurate and does not display every line as changed.
Maybe the functionality of these two options should be merged into one?
Heya @Kiougar, thanks for the work getting those features into jsdiff! I would appreciate a PR here to use it, yes.
Unless there are strong opinions otherwise, my instinct says to just default to --ignore-space and --ignore-line-endings, without presenting the options even. It's also easier to implement this way.
I'm not sure if we should default to ignore-space since the ignoreWhitespace option of the diff module removes the formatting of the code when it is outputted to the console (see below for sample output).
I personally do not care about the formatting, since it is only a visual issue; but it might be misleading to some people, that when accepting the differences the new file would lose the formatting.
Also, the ignore-line-endings(which AFAIK the diff module does not support - correct me if I'm wrong) has to be solved with the following "trick":
Use .replace(/\r\n/g, "\n") on both strings that need to be compared so that they have the same line endings.
The ignore-line-endings can be implemented by default since I don't see any scenarios that it might not work properly.
Here is an example of the output with ignore-line-endings and ignore-space:
Edit: If you click the source link the output will not be properly displayed until you click inside the output container. Don't know why this happens...
We're getting rid of update and init because they won't be needed after the release. They were temporary tools that were useful during the rough transition from beta, and going forward the only things needed for upgrading from 1.0.0 to 1.0.1 will be to npm install.
Activity
Kiougar commentedon Dec 2, 2016
@bougnat12 @filipesilva
I have made a pull request to the
jsdiffmodule, which is used to generate the diff. When that pull request is accepted I would gladly create a pull request to this repo to add the--ignore-spaceoption.Another option I would also suggest is
--ignore-line-endings. That way the diff is more accurate and does not display every line as changed.Maybe the functionality of these two options should be merged into one?
What do you think?
Kiougar commentedon Dec 26, 2016
@filipesilva
jsdiff v3.2.0has been released that includes my previously mentioned pull request.Should I proceed with a pull request in this repo that adds the --ignore-space option?
filipesilva commentedon Dec 28, 2016
Heya @Kiougar, thanks for the work getting those features into jsdiff! I would appreciate a PR here to use it, yes.
Unless there are strong opinions otherwise, my instinct says to just default to
--ignore-spaceand--ignore-line-endings, without presenting the options even. It's also easier to implement this way.Kiougar commentedon Dec 28, 2016
Hey @filipesilva.
I'm not sure if we should default to
ignore-spacesince theignoreWhitespaceoption of thediffmodule removes the formatting of the code when it is outputted to the console (see below for sample output).I personally do not care about the formatting, since it is only a visual issue; but it might be misleading to some people, that when accepting the differences the new file would lose the formatting.
Also, the
ignore-line-endings(which AFAIK thediffmodule does not support - correct me if I'm wrong) has to be solved with the following "trick":.replace(/\r\n/g, "\n")on both strings that need to be compared so that they have the same line endings.The
ignore-line-endingscan be implemented by default since I don't see any scenarios that it might not work properly.Here is an example of the output with
ignore-line-endingsandignore-space:Old file contents:
New file contents:
createPatch output:
source
Edit: If you click the source link the output will not be properly displayed until you click inside the output container. Don't know why this happens...
feat(update): Ignore spaces and EOLs when comparing; use `--compare-s…
feat(update): Ignore spaces and EOLs when comparing files
feat(update): Ignore spaces and EOLs when comparing files
feat(update): Ignore spaces and EOLs when comparing files
feat(update): Ignore spaces and EOLs when comparing files
hansl commentedon Feb 7, 2017
We're getting rid of
updateandinitbecause they won't be needed after the release. They were temporary tools that were useful during the rough transition from beta, and going forward the only things needed for upgrading from 1.0.0 to 1.0.1 will be tonpm install.angular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.