Code is for computer, comments are for humans.
. . .
. . .
. . .
Function: lintr::lint(filename)
The lintr package in R:
The flake8
library in Python:
Function: flake8 path/to/code/to/check.py
The styler package in R:
Function: styler::style_file(filepath)
The black
library in Python:
Function:: black {source_file_or_directory}
Run a linter through your code and identify style issues:
Edit your code to improve the style compatibility, based on the feedback from your linter.
Run an autoformatter through your code to automatically fix issues instead of simply flagging them:
If you find code that is hard to read, or variable names that need adjusting, make a note to work on it. Use #TODO or another consistent label so you can extract these notes later.
Workshop Computational Reproducibility