Skip to content

Deprecate extraction_operator_linter() #2409

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

Merged
merged 6 commits into from
Dec 10, 2023

Conversation

IndrajeetPatil
Copy link
Collaborator

@IndrajeetPatil IndrajeetPatil commented Dec 10, 2023

Closes #1485
Closes #1484

@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3fd90ba) 98.64% compared to head (a96cb77) 98.64%.

❗ Current head a96cb77 differs from pull request most recent head fdbaa1b. Consider uploading reports for the commit fdbaa1b to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2409   +/-   ##
=======================================
  Coverage   98.64%   98.64%           
=======================================
  Files         126      125    -1     
  Lines        5623     5628    +5     
=======================================
+ Hits         5547     5552    +5     
  Misses         76       76           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

IndrajeetPatil and others added 2 commits December 10, 2023 12:09
Co-authored-by: Michael Chirico <michaelchirico4@gmail.com>
MichaelChirico
MichaelChirico previously approved these changes Dec 10, 2023
Copy link
Collaborator

@MichaelChirico MichaelChirico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@IndrajeetPatil IndrajeetPatil marked this pull request as ready for review December 10, 2023 06:53
@IndrajeetPatil
Copy link
Collaborator Author

Ah, there are new warnings detected by the vigilant workflow that need to be dealt with before we can merge this.

@IndrajeetPatil
Copy link
Collaborator Author

I don't understand what's going on here.

In the dummy_packages/package we are using in test-cache.R (e.g.), we don't specify extraction_operator_linter in the config and just set linters: linters_with_defaults(), so why do we see the following warning?

Trying to remove 'extraction_operator_linter', which is not in defaults.

Full traceback:

── Warning (test-cache.R:446:3): cache = TRUE workflow works ───────────────────
Warning encountered while loading config:
  Warning from config setting 'linters' in 'NULL':
    Trying to remove 'extraction_operator_linter', which is not in `defaults`.
Backtrace:1. ├─lintr::lint_package(pkg, cache = TRUE) at test-cache.R:446:3
  2. │ └─lintr:::read_settings(pkg_path) at lintr/R/lint.R:249:5
  3. │   └─lintr:::read_config_file(config_file) at lintr/R/settings.R:74:3
  4. │     ├─base::withCallingHandlers(...) at lintr/R/settings.R:140:3
  5. │     ├─base::tryCatch(load_config(config_file), error = malformed)
  6. │     │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  7. │     │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8. │     │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
  9. │     └─lintr (local) load_config(config_file)
 10. │       ├─base::withCallingHandlers(...) at lintr/R/settings.R:113:9
 11. │       ├─base::tryCatch(...)
 12. │       │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 13. │       │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 14. │       │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 15. │       ├─base::eval(parsed_setting)
 16. │       │ └─base::eval(parsed_setting)
 17. │       └─lintr::all_linters(...)
 18. │         └─lintr::linters_with_tags(tags = NULL, packages = packages, ...) at lintr/R/with.R:141:3
 19. │           └─lintr::modify_defaults(..., defaults = tagged_linters) at lintr/R/with.R:124:3
 20. │             └─base::warning(...) at lintr/R/with.R:48:5
 21. ├─base::.signalSimpleWarning(...)
 22. │ └─base::withRestarts(...)
 23. │   └─base (local) withOneRestart(expr, restarts[[1L]])
 24. │     └─base (local) doWithOneRestart(return(expr), restart)
 25. ├─lintr (local) `<fn>`(`<smplWrnn>`)
 26. │ └─base::warning(...) at lintr/R/settings.R:125:13
 27. ├─base::.signalSimpleWarning(...)
 28. │ └─base::withRestarts(...)
 29. │   └─base (local) withOneRestart(expr, restarts[[1L]])
 30. │     └─base (local) doWithOneRestart(return(expr), restart)
 31. └─lintr (local) `<fn>`(`<smplWrnn>`)

@AshesITR
Copy link
Collaborator

AshesITR commented Dec 10, 2023

Traceback no 17. shows that it runs all_linters(). Seems to pick up our config, where the warning is correct because all_linters() excludes deprecated and defunct linters by default.

TL;DR: Remove extraction_operator_linter = NULL from our .lintr.

@IndrajeetPatil
Copy link
Collaborator Author

TL;DR: Remove extraction_operator_linter = NULL from our .lintr.

This is what I had thought, but then I realized that this is going to cause the lint workflow to fail IINM.
I hope we don't have to add # nolint directives to everywhere $ is appearing.

@IndrajeetPatil IndrajeetPatil merged commit 32cb18c into main Dec 10, 2023
@IndrajeetPatil IndrajeetPatil deleted the deprecate-extraction-linter branch December 10, 2023 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants