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

Consistent handling of Encoding #752

Closed
AshesITR opened this issue Feb 13, 2021 · 0 comments · Fixed by #782
Closed

Consistent handling of Encoding #752

AshesITR opened this issue Feb 13, 2021 · 0 comments · Fixed by #782
Labels
feature a feature request or enhancement
Milestone

Comments

@AshesITR
Copy link
Collaborator

Currently, we use readLines() when linting, which assumes the system encoding when parsing files.

This results in uncovered lines w.r.t. fixing column numbers of UTF-8 Multibyte characters (at least on Windows, cf. #739) and in bugs when the file encoding doesn't match the system encoding (cf. #541)

lintr should

  • get a new setting encoding with a smart default (see below) overridable in the usual ways.
  • respect this setting in get_source_expressions()
  • Update the tests to force UTF-8 encoding where necessary

The smart default for encoding should pick the first valid option of this list:

  1. The Encoding field in a package DESCRIPTION
  2. The Encoding field from the .Rproj file in a project directory
  3. UTF-8

This default is system-independent and thus should be safe to use.

@AshesITR AshesITR added the feature a feature request or enhancement label Feb 13, 2021
@AshesITR AshesITR added this to the 3.0.0 milestone Mar 8, 2021
@AshesITR AshesITR linked a pull request Mar 16, 2021 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant