Skip to content

[Linting Rule] True False Abbreviation

github-actions[bot] edited this page Nov 8, 2026 · 1 revision

Generated from 'wiki-linter.ts' on 2026-10-25, 09:29:25 UTC (v2.16.6), do not edit directly.

TRUE/FALSE Abbreviation [overview]

smell cmd-check 37 quickfix readability robustness

This rule ports the following steps of R CMD check (see the conformance table for the legend):

# Step Coverage Note
37 R code for possible problems (book) 🟩⭐ ⭐ also quick fixes, deprecated arguments, environments resolved through variables, hooks followed into callees

This rule is a exact rule.

Finds T and F used for TRUE and FALSE, and top-level definitions of T or F. Off by default, as R only checks this for packages without a NAMESPACE.
This linting rule is implemented in src/linter/rules/cmd-check/true-false-abbreviation.ts.

Configuration

Linting rules can be configured by passing a configuration object to the linter query as shown in the example below. The true-false-abbreviation rule accepts the following configuration options:

  • reportRedefinitions
    report definitions of T or F, which change what every later abbreviation means (default true)
    R CMD check #37

Examples

f <- function(x) mean(x, na.rm = T)

The linting query can be used to run this rule on the above example:

[ { "type": "linter",   "rules": [ { "name": "true-false-abbreviation",     "config": {} } ] } ]

Results (prettified and summarized):

Query: linter (2 ms)
   ╰ TRUE/FALSE Abbreviation (true-false-abbreviation):
       ╰ certain:
           ╰ Use of T at 1.34 (1 quick fix(es) available)

More examples are the test cases in test/functionality/linter/cmd-check/lint-true-false-abbreviation.test.ts.

Clone this wiki locally

⌂ 换网址