Skip to contents

The default settings consist of

  • linters: a list of default linters (see default_linters())

  • encoding: the character encoding assumed for the file

  • exclude: pattern used to exclude a line of code

  • exclude_start, exclude_end: patterns used to mark start and end of the code block to exclude

  • exclude_linter, exclude_linter_sep: patterns used to exclude linters

  • exclusions: a list of exclusions, see exclude() for a complete description of valid values.

  • cache_directory: location of cache directory

  • comment_token: a GitHub token character

  • error_on_lint: decides if error should be produced when any lints are found

There are no settings without defaults, i.e., this list describes every valid setting.

Usage

default_settings

Format

An object of class list of length 12.

Examples

# available settings
names(default_settings)
#>  [1] "linters"            "encoding"           "exclude"           
#>  [4] "exclude_next"       "exclude_start"      "exclude_end"       
#>  [7] "exclude_linter"     "exclude_linter_sep" "exclusions"        
#> [10] "cache_directory"    "comment_token"      "error_on_lint"     

# linters included by default
names(default_settings$linters)
#>  [1] "assignment_linter"                "brace_linter"                    
#>  [3] "commas_linter"                    "commented_code_linter"           
#>  [5] "equals_na_linter"                 "function_left_parentheses_linter"
#>  [7] "indentation_linter"               "infix_spaces_linter"             
#>  [9] "line_length_linter"               "object_length_linter"            
#> [11] "object_name_linter"               "object_usage_linter"             
#> [13] "paren_body_linter"                "pipe_continuation_linter"        
#> [15] "quotes_linter"                    "return_linter"                   
#> [17] "semicolon_linter"                 "seq_linter"                      
#> [19] "spaces_inside_linter"             "spaces_left_parentheses_linter"  
#> [21] "T_and_F_symbol_linter"            "trailing_blank_lines_linter"     
#> [23] "trailing_whitespace_linter"       "vector_logic_linter"             
#> [25] "whitespace_linter"               

# default values for a few of the other settings
default_settings[c(
  "encoding",
  "exclude",
  "exclude_start",
  "exclude_end",
  "exclude_linter",
  "exclude_linter_sep",
  "exclusions",
  "error_on_lint"
)]
#> $encoding
#> [1] "UTF-8"
#> 
#> $exclude
#> #[[:space:]]*nolint
#> 
#> $exclude_start
#> #[[:space:]]*nolint start
#> 
#> $exclude_end
#> #[[:space:]]*nolint end
#> 
#> $exclude_linter
#> ^[[:space:]]*:[[:space:]]*(?<linters>(?:(?:[^,.])+[[:space:]]*,[[:space:]]*)*(?:[^,.])+)\.
#> 
#> $exclude_linter_sep
#> [[:space:]]*,[[:space:]]*
#> 
#> $exclusions
#> list()
#> 
#> $error_on_lint
#> [1] FALSE
#>