Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(command): add output option to ng lint command #4853

Closed
wants to merge 1 commit into from

Conversation

moritz-h
Copy link
Contributor

Add output option to ng lint command to redirect lint result to file.

Fix #4791

Add output option to ng lint command to redirect lint result to file.

Fix angular#4791
@filipesilva
Copy link
Contributor

Heya, we try to avoid these output commands in general since you can just use console pipes to redirect output (e.g. ng lint > log.txt).

If that's not working it would be better to fix the broken code instead of providing an output option. In the case of #4791 it seems like the checkstyle format should have a special output format, with only xml.

@moritz-h
Copy link
Contributor Author

@filipesilva
To fix the code would it be ok to just remove this 2 lines:
ui.writeLine(chalk.red('Lint errors found in the listed files.'));
ui.writeLine(chalk.green('All files pass linting.'));
from here: https://github.com/angular/angular-cli/blob/master/packages/%40angular/cli/tasks/lint.ts#L64-L71
Then using piping is fine no matter what format. Or do you want this lines for default output?

Or is it somehow possible to print these lines to stderr so you can pipe ng lint 1> log.txt?

@filipesilva
Copy link
Contributor

Those lines should stay overall, but you can specialcase the xml format to not output them. You should also fix the success xml output for that one.

@moritz-h moritz-h deleted the ng-lint-output-option branch February 22, 2017 11:26
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"lint --format checkstyle" produces invalid output
3 participants