View source: R/03b_doubleSpaceLinter.R View source: R/03a_additionalLinters.R
get_code_lints | R Documentation |
The function logic is to compare locations of nodes in the same 'line1' value, which stands for the line number of a node in a Script. A node in code can be, for example, a comma, an assignment arrow or a number. F.e., consider these three nodes: "(", "," and ")". If the first node ends at position "4" and the second node starts at a position larger than "7", we have at least a double space in between (position 5 + 6). The second node 'i+1' (the right part of a double space) is directly converted into a lint list.
The function logic is to compare locations of nodes in the same 'line1' value, which stands for the line number of a node in a Script. A node in code can be, for example, a comma, an assignment arrow or a number. F.e., consider these three nodes: "(", "," and ")". If the first node ends at position "4" and the second node starts at a position larger than "7", we have at least a double space in between (position 5 + 6). The second node 'i+1' (the right part of a double space) is directly converted into a lint list.
get_code_lints(unique_lines, code_nodes, source_expression)
get_code_lints(unique_lines, code_nodes, source_expression)
unique_lines |
A vector of line numbers for each instance of written code |
code_nodes |
Node list extracted with the XPath for code |
source_expression |
Contains the XML parsed content. Needed for transforming nodes to lints |
List of lints containing invalid double spaces
List of lints containing invalid double spaces
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.