From 71c504df181c493411fffa99aeba6bd69964b89a Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Thu, 23 Apr 2020 07:50:07 -0500 Subject: [PATCH] adding shell --- docs/disabling-linters.md | 50 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/docs/disabling-linters.md b/docs/disabling-linters.md index 285d5343..8d7f6513 100644 --- a/docs/disabling-linters.md +++ b/docs/disabling-linters.md @@ -11,6 +11,7 @@ Below is examples and documentation for each language and the various methods to - `.ruby-lint.yml` - You can pass multiple rules and overwrite default rules - File should be located at: `.github/linters/.ruby-lint.yml` +- **Note:** We use the Default **GitHub** Rule set from [Rubocop-GitHub](https://github.com/github/rubocop-github) ### Rubocop disable single line ```ruby @@ -26,14 +27,61 @@ var="this is some other stuff" ``` ### Rubocop disable entire file -If you need to ignore an entire file, you can update the `.ruby-lint.yml` +If you need to ignore an entire file, you can update the `.ruby-lint.yml` to ignore certain files and locations + +```yml +inherit_from: + - .rubocop_todo.yml + - .rubocop_app_overrides.yml + +inherit_mode: + merge: + - Exclude + +Rails: + Enabled: true + +AllCops: + TargetRubyVersion: 2.5.1 + EnabledByDefault: true + Exclude: + - 'db/**/*' + - 'config/**/*' + - 'script/**/*' + - 'bin/{rails,rake}' + - !ruby/regexp /old_and_unused\.rb$/ +``` + -------------------------------------------------------------------------------- ## Shell +**Shellcheck** is an opensource tool we use for linting and validation of shell scripting. +- [Shellcheck](https://github.com/koalaman/shellcheck) + ### Shellcheck Config file +- There is no top level *configuration file* available at this time + ### Shellcheck disable single line +```bash +echo "Terrible stuff" # shellcheck disable=SC2059,SC2086 +``` + ### Shellcheck disable code block +```bash +# shellcheck disable=SC2059,SC2086 +echo "some hot garbage" +echo "More garbage code" +``` + ### Shellcheck disable entire file +- **Note:** The disable must be on the second line of the code right after the shebang +```bash +#!/bin/sh +# shellcheck disable=SC2059,SC1084 + +echo "stuff" +moreThings() +``` --------------------------------------------------------------------------------