Package 'textlintr'

Title: Natural Language Linter Tools for 'R Markdown' and R Code
Description: What the package does (one paragraph).
Authors: Shinya Uryu [aut, cre] , azu [cph] (textlint JavaScript library)
Maintainer: Shinya Uryu <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2024-10-30 04:00:45 UTC
Source: https://github.com/uribo/textlintr

Help Index


Install textlint rule modules

Description

Install textlint rule modules

Usage

add_rules(rules = NULL, scope = "dev")

Arguments

rules

the name of rule; see rule_sets() and https://github.com/textlint/textlint/wiki/Collection-of-textlint-rule.

scope

'dev' or 'global'.

Examples

## Not run: 
add_rules("first-sentence-length", "dev")
# Skip already exist are ignored
add_rules(c("no-todo", "first-sentence-length"), scope = "dev")
# Global install
add_rules("first-sentence-length", "global")

## End(Not run)

Check textlint running environment

Description

Check textlint running environment

Usage

check_dependencies_available(.node_module_path = NULL)

Arguments

.node_module_path

By default, it refers to the global path and local directory. If an arbitrary path is given, it refers to that path.

Examples

## Not run: 
is_available_textlint()

## End(Not run)

Config textlint rule file

Description

Config textlint rule file

Usage

configure_lint_rules(lintrc = ".textlintrc", open = FALSE)

Arguments

lintrc

file path to .textlintrc. Default, searcing from current directory.

open

If you want to modify a .textlintrc, set TRUE. (deafult FALSE)

Value

list

Examples

## Not run: 
configure_lint_rules()

## End(Not run)

Initialise a textlint

Description

Initialise a textlint

Usage

init_textlintr(rules = "common-misspellings", scope = "dev")

Arguments

rules

the name of rule; see rule_sets() and https://github.com/textlint/textlint/wiki/Collection-of-textlint-rule.

scope

'dev' or 'global'.

Examples

## Not run: 
init_textlintr()

## End(Not run)

Test for the existence of textlint as a prerequisite

Description

Test for the existence of textlint as a prerequisite

Usage

is_available_textlint(.node_module_path = NULL)

Arguments

.node_module_path

By default, it refers to the global path and local directory. If an arbitrary path is given, it refers to that path.

Examples

## Not run: 
is_available_textlint()

## End(Not run)

Check if rule is installed

Description

Check if rule is installed

Usage

is_rule_exist(rules)

Arguments

rules

the name of rule; see rule_sets() and https://github.com/textlint/textlint/wiki/Collection-of-textlint-rule.

Examples

## Not run: 
is_rule_exist("no-todo")
is_rule_exist("first-sentence-length")

## End(Not run)

Available rule names

Description

Available rule names

Usage

rule_sets(rules = NULL)

Arguments

rules

the name of rule; see rule_sets() and https://github.com/textlint/textlint/wiki/Collection-of-textlint-rule.

Examples

rule_sets(rules = c("common-misspellings", "preset-jtf-style"))

Textlint a given file

Description

Textlint a given file

Usage

textlint(file = NULL, lintrc = ".textlintrc", markers = TRUE, ...)

Arguments

file

filename whose target to textlint

lintrc

file path to .textlintrc. Default, searcing from current directory.

markers

modified output format. If true, the result of lint is displayed in RStudio's marker panel (Only when running with RStudio version higher than 0.99.225).

...

path to other function

Examples

## Not run: 
lint_target <-
  system.file("sample.md", package = "textlintr")
textlint(lint_target)

## End(Not run)

Update .textlintrc

Description

Update the rule file (.texlintrc) which textlint checks. To adopt the rule of the character string specified as argument. When NULL is given, all installed rules are applied.

Usage

update_lint_rules(
  rules = NULL,
  lintrc = ".textlintrc",
  overwrite = FALSE,
  .node_module_path = NULL
)

Arguments

rules

the name of rule; see rule_sets() and https://github.com/textlint/textlint/wiki/Collection-of-textlint-rule.

lintrc

file path to .textlintrc. Default, searcing from current directory.

overwrite

logical. If set TRUE, existing rules will be overwritten by the input rules.

.node_module_path

By default, it refers to the global path and local directory. If an arbitrary path is given, it refers to that path.

Examples

## Not run: 
# Register all installed rules
update_lint_rules()
# Added a rule
update_lint_rules(rules = "common-misspellings", overwrite = FALSE)
# Overwrite rules
update_lint_rules(rules = "common-misspellings", overwrite = TRUE)

## End(Not run)