Skip to content
New issue

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

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

Already on GitHub? # to your account

Introduce automatic splitting of long lines #6

Open
pseewald opened this issue Sep 1, 2016 · 6 comments
Open

Introduce automatic splitting of long lines #6

pseewald opened this issue Sep 1, 2016 · 6 comments
Labels
enhancement Enhancement to existing feature
Milestone

Comments

@pseewald
Copy link
Collaborator

pseewald commented Sep 1, 2016

It's a useful feature and should not be too hard to implement

@pseewald pseewald added the enhancement Enhancement to existing feature label Sep 1, 2016
@pseewald pseewald self-assigned this Dec 24, 2016
@pseewald pseewald added this to the v0.4 milestone Dec 24, 2016
@pseewald pseewald removed their assignment Aug 31, 2018
@giovannipizzi
Copy link

giovannipizzi commented Sep 18, 2018

Hi, at the moment even if the splitting is not done automatically, I would like to stop as an error if the line is too long, and switching this on with a command-line switch. The reason is that I'm using

By looking at the code, the way I would do it is to have a flag that converts WARNING level logs to errors and stop.
What do you think? (Another option: if there is any output from the code, then stop)
Or is there an easy way to say to pre-commit "if there is output in stderr, please stop"?

@pseewald
Copy link
Collaborator Author

I'd prefer to not introduce such a flag and to stop only for failures. It is not a problem for fprettify to handle long lines. As long as the input code is standard conforming, fprettify should not stop with an error. So I leave it up to you to check the warning message (but I don't know how to do that with pre-commit).

@giovannipizzi
Copy link

I see your point, but at the moment the indentation is wrong and until this issue is fixed we get a "wrong" output... a person can easily split and run again fprettify.

I understand you don't want to change the code, but would you accept an extension (optional for users) to the pre-commit file in your repo, that wraps fprettify and exits with a non-zero error code if there is any output? Most people wouldn't notice but I could use it.

@giovannipizzi
Copy link

Never mind, I think I found a way to do this directly in my repo: giovannipizzi/wannier90@01d1231

@varchasgopalaswamy
Copy link

is line splitting going to be implemented? It would be very helpful for legacy code

@pseewald
Copy link
Collaborator Author

I still agree that this should be a feature, unfortunately I won't have time in the near future to implement this.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement Enhancement to existing feature
Projects
None yet
Development

No branches or pull requests

3 participants