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

get_source_expressions() should get a way to parse encodings directly #2806

Open
MichaelChirico opened this issue Mar 3, 2025 · 1 comment
Labels
blocked-internal Fulfillment of this issue is blocked until another lintr issue is finished feature a feature request or enhancement

Comments

@MichaelChirico
Copy link
Collaborator

source_expression <- srcfile(filename, encoding = settings$encoding)

Follow-up to #2803. Here as well we have get_source_expressions() relying on settings$encoding having been set elsewhere, meaning it's not very useful to call get_source_expressions() directly on a nonstandard-encoded file whose encoding can be inferred from settings.

Probably easiest to just expose encoding= as an argument, and/or possibly include parse_settings as an argument.

@AshesITR
Copy link
Collaborator

AshesITR commented Mar 4, 2025

I would wait for the interface overhaul to parse_settings= (#1177) before exposing it. But that seems like a good call.

The new interface would allow specifying the encoding via custom settings anyway (e.g. config = list(encoding = "latin1"))

@MichaelChirico MichaelChirico added feature a feature request or enhancement blocked-internal Fulfillment of this issue is blocked until another lintr issue is finished labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked-internal Fulfillment of this issue is blocked until another lintr issue is finished feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants