Skip to content

Ignore these lines #533

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

Closed
russHyde opened this issue Jul 10, 2019 · 7 comments
Closed

Ignore these lines #533

russHyde opened this issue Jul 10, 2019 · 7 comments

Comments

@russHyde
Copy link

Is there a way to tell styler not to style a subset of the lines in a file?
I couldn't find anything in the docs or the github issues.

@lorenzwalthert
Copy link
Collaborator

Thanks for searching first :-) We decided against this in (agree hard to find) #365 for the reasons outlined there. Note that as far as alignment goes, there are considerations to detect certain patterns and don't apply styling, see #258.

@lorenzwalthert
Copy link
Collaborator

If you want you can try the version of the WIP for detecting alignment, but no guarantees about future maintenance or further development. https://github.com/lorenzwalthert/styler/tree/detect-alignment. The goal is, however, to once finish this up and merge it into master. You can also subscribe to the other issue to make sure you don't miss anything.

@lorenzwalthert
Copy link
Collaborator

@russHyde by popular request we think we might anyways implement this feature (although I don't recommend using it) and progress is tracked in #365 if you want to follow up on that.

@russHyde
Copy link
Author

Thanks. It was the introduction of the {{ syntax in rlang (and the expectation that additional syntax might be added that styler wouldn't immediately handle; I appreciate that you've addressed {{ in styler) that spurred me to ask about this. However, I've rethought my process and tried to remove 'weird new syntax' from my packages as much as possible ...

@lorenzwalthert
Copy link
Collaborator

Ok. Yes, I suppose it would have been helpful for me to know that earlier, I could have pointed you to #528 :-). In almost any problem with styling, there is a general rule we can derive from it and which I am happy to implement (as it is obvious to me we need to handle {{). I'll make a CRAN submission soon as you might have seen in #556 so this should lower the barrieres to use styler again 😄 . In the meanwhile, you can just install from the master branch from GitHub.

This was referenced Oct 16, 2019
@lorenzwalthert
Copy link
Collaborator

lorenzwalthert commented Oct 22, 2019

We have a draft :-). Feedback welcome, please in the PR (#560), not here in the issue.

remotes::install_github("lorenzwalthert/styler@stylerignore")

@lorenzwalthert
Copy link
Collaborator

Closed with #560.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants