forked from fengguang/lkp-tests
-
Notifications
You must be signed in to change notification settings - Fork 157
Coding Standard
Philip Li edited this page Apr 17, 2023
·
2 revisions
We use shellcheck and rubocop to promise the basic consistency and quality of shell and ruby codes respectively. It is valuable to go through the docs to check out some good practices, and try.
$ cd path/to/lkp-tests
$ sudo -E gem install bundler
$ bundle install
Getting started
$ sudo apt-get install shellcheck
$ shellcheck path/to/file
$ rake shellcheck # check all necessary files of the repo with warning or error severity
Reference
Getting started
$ rake rubocop
$ rake rubocop file="lib/**/*.rb" # check all rb files under lib
$ rake rubocop file=pattern/of/files # match arbitrary pattern
Reference
Getting started
$ rake spec # check all unit tests status
$ rake spec spec=yaml # check spec/yaml_spec.rb status
Reference