https://github.com/atsyplenkov/formalist
Positron extension to make R function calls explicit and fix lints on demand
https://github.com/atsyplenkov/formalist
Last synced: 3 months ago
JSON representation
Positron extension to make R function calls explicit and fix lints on demand
- Host: GitHub
- URL: https://github.com/atsyplenkov/formalist
- Owner: atsyplenkov
- License: mit
- Created: 2024-12-16T02:54:11.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-30T22:53:32.000Z (11 months ago)
- Last Synced: 2025-02-07T12:09:19.671Z (11 months ago)
- Language: JavaScript
- Homepage: https://open-vsx.org/extension/atsyplenkov/formalist
- Size: 8.54 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://open-vsx.org/extension/atsyplenkov/formalist) [](https://github.com/atsyplenkov/formalist/actions/workflows/publish-extensions.yml)  [](https://www.repostatus.org/#wip)
# Formalist — Positron Extension
> [!IMPORTANT]
> The extension is designed to work **ONLY** in
> [Positron](https://github.com/posit-dev/positron) IDE starting from version `2025.01.0`, as it heavily depends
> on the Positron API.
# Features
> [!NOTE]
> All features work on selected text. If no text is selected, you'll receive a notification to make a selection first.
## Make R Function Calls Explicit
`Formalist` can make R function calls explicit, instead of implicit ones, using the [`{pedant}`](https://github.com/wurli/pedant) R package. In other words, it checks the currently attached packages, i.e., the ones already loaded using `library()`, and transforms R function calls like `select(mtcars, mpg, cyl)` into `dplyr::select(mtcars, mpg, cyl)`.

## Fix Lints
Another key feature of `Formalist` is its ability to detect and correct lints in your R code. The linting process is performed locally using the [`{flir}`](https://github.com/etiennebacher/flir) package, which must be installed in your R environment.

> [!TIP]
> The `{flir}` R package installs in your current environment, so, you can setup your custom lint rules by running `flir::setup_flir()` in your R console (read more [here](https://flir.etiennebacher.com/articles/adding_rules)).
# Installation
The extension is published on the [Open VSX Registry](https://open-vsx.org/extension/atsyplenkov/formalist): just click `Install` there or manually install it with:
1) Start the [Positron](https://github.com/posit-dev/positron).
2) Inside Positron, go to the extensions view either by executing the `View: Show Extensions` command (click `View` -> `Command Palette...`) or by clicking on the extension icon on the left side of the Positron window.
3) In the extensions view, simply search for the term `Formalist` in the marketplace search box, then select the extension named `Formalist` and click the install button.
Alternatively, you can install the latest version from the [Releases](https://github.com/atsyplenkov/formalist/releases/) page. Download the latest `.vsix` file and install it as described [here](https://code.visualstudio.com/docs/editor/extension-marketplace#_install-from-a-vsix).
## Dependencies
`Formalist` depends on two R packages [`{pedant}`](https://github.com/wurli/pedant) and [`{flir}`](https://github.com/etiennebacher/flir). If your current environment is lacking either of them, you will be prompted to install them.

# Questions and Feature Requests
There's a lot going on with the development of new features in `Formalist`. If you have any questions or something is not working, feel free to [open an issue](https://github.com/atsyplenkov/formalist/issues) or start a conversation on [Mastodon](https://fosstodon.org/@atsyplenkov).
# Contributions
Contributions are welcome! If you'd like to contribute, please, fork, submit a PR and I'll merge it.