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

Modify .lintr file search algorithm #1746

Closed
tonyk7440 opened this issue Oct 21, 2022 · 3 comments · Fixed by #1757
Closed

Modify .lintr file search algorithm #1746

tonyk7440 opened this issue Oct 21, 2022 · 3 comments · Fixed by #1757
Labels

Comments

@tonyk7440
Copy link
Contributor

We have a multi language team and I am trying to roll out a common linter for the team instead of a different structure for each language. I've been testing super-linter with R and I am coming into a few issues for R.

One is that super-linter expects configurations files all live in the folder .github/linters but it seems from here that lintr doesn't check that path meaning that running functions in RStudio don't detect the above file.

I currently have two .lintr files, one in the project root and one in .github/linters that are just a copy of one another to get around this issue.

Wondering if .github/linters could be added to the search list?

@MichaelChirico
Copy link
Collaborator

What about making it a symlink instead? That way you can still maintain only one config

@AshesITR
Copy link
Collaborator

I would suggest to use a symlink or, in case of a company-wide config, use $HOME/.lintr locally.

@tonyk7440
Copy link
Contributor Author

Thanks for the responses!

I tried the symlink approach but this does not work when using a Windows and Google drive.

For the $HOME approach, the problem I see with this is that you still need two .lintr files, one in .github/linters and another in $HOME. And also, since the file in $HOME is not per project then when exclusions need to be specified for different projects they all need to be added in the same file

tonyk7440 added a commit to tonyk7440/lintr that referenced this issue Oct 28, 2022
tonyk7440 added a commit to tonyk7440/lintr that referenced this issue Oct 28, 2022
tonyk7440 added a commit to tonyk7440/lintr that referenced this issue Nov 1, 2022
tonyk7440 added a commit to tonyk7440/lintr that referenced this issue Nov 4, 2022
tonyk7440 added a commit to tonyk7440/lintr that referenced this issue Nov 4, 2022
tonyk7440 added a commit to tonyk7440/lintr that referenced this issue Nov 4, 2022
tonyk7440 added a commit to tonyk7440/lintr that referenced this issue Nov 6, 2022
tonyk7440 added a commit to tonyk7440/lintr that referenced this issue Nov 6, 2022
tonyk7440 added a commit to tonyk7440/lintr that referenced this issue Nov 6, 2022
tonyk7440 added a commit to tonyk7440/lintr that referenced this issue Apr 14, 2023
tonyk7440 added a commit to tonyk7440/lintr that referenced this issue Apr 14, 2023
MichaelChirico added a commit that referenced this issue May 22, 2023
* check for .lintr file in extra subdirectory

* #1746 update news

* #1746 update vignette

* #1757 reduce cyclomatic complexity, move local check above global file

* #1746 updates from review

* #1746 correct vignette order, update news bullet

* #1746 try adding test

* #1746 tests, programatically create `.github` dir

* #1746 remove .lintr settings file

* #1746 better cleanup, use file_path better

* #1746 one more file_path update

* #1746 updates from review comments

* #1746 update news per comment

* Fix the test case for #1757

Previously the test case never failed, even without the relevant patch.

* Add failing test for subdirs

This test will currently fail, and should no longer fail once
`.github/linters` is searched in parent directories as well as in the
current directory.

* Search for `.github/linters` in parent directories

* Remove unnecessary code

* Amend news and lintr config search description

Fixed the description based on review, performed very minor copy
editing, and adapted formatting to be consistent.

* Attempt to make description clearer

* Fix indentation

---------

Co-authored-by: AshesITR <alexander.rosenstock@web.de>
Co-authored-by: Michael Chirico <chiricom@google.com>
Co-authored-by: Konrad Rudolph <konrad.rudolph@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants