Enhance shellcheck lint target (1 of 3 -- help.mk)

makefiles/lint/shell/help.mk
----------------------------
  o Top level include used to source all lint-shell library makefiles.
  o Loosely based on makefiles/{groovy,doc8}/*.
  o Currently library makefile makefiles/shell.mk deprecation pending.
  o Prefix yet-to-be-added makefile includes with hyphen to prevent errors.

makefiles/lint/shell/help.mk
----------------------------
  o Document new lint-shell makefile convenience targets being added.
  o 'make help' will display a target summary for lint-shell:
    - primary lint target name
    - target name used to display extended help.
  o 'make lint-shell-help' will display extended help (3 targets):
    - make lint-shell-all  (current target behavior)
    - make lint-shell-mod  (limit shellcheck to locally modified files)
    - make lint-shell-src  (shellcheck a list of files passd in)
  o Targets can be explicitly used by name.
  o One of the three targets will become a dependency for:
    - make lint         # if shellcheck is a default repository lint target.
    - make lint-shell   # common target name for shellcheck linting.

unit-testing:
Helper script mcheck.sh will create a usable sandbox from shellcheck patches to evaluate targets.
shellcheck (make lint-shell*) will report problems in bin/setup.sh:
  o https://wiki.opennetworking.org/display/VOLTHA/repo%3Aonf-make

Change-Id: I5a7f6c9b4c43ce973b65900b097977d422be8aa5
2 files changed
tree: 27a6f18d950689bd1d90685436cb9e9966cf84f7
  1. .gitignore
  2. .gitreview
  3. Makefile
  4. README.md
  5. bin/
  6. config.mk
  7. makefiles/
  8. makefiles_include_mk.ex
README.md

onf-make library makefiles

This repository contains common makefile logic and targets that can be used to build arbitrary repositories. Makefile logic is currently being consumed by the VOLTHA project

makefiles/ subdirectories

Two distinct sets of makefiles are needed to support builds:

  • The first is a subdir of makefiles/ named 'onf-make'

    • This directory exists and is maintained as a git-submodule of repo:onf-make.
    • Library makefiles contain independent logic to install common tools such as (virtualenv), perform linting tasks, define constants and perform path/string manipulation, etc.
  • The second makefile directory contains repository/project specific logic:

    • makefiles/local/ exists as a repository subdirectory under SCM.
    • Contains custom targets, variant parameters and custom logic specific to the repository it exists within.
  • Most makefile logic can be parameterized and implemented to support reuse. Consider adding enhancements or refactoring local/ makefile logic into repo:onf-make so all makefiles can leverage it.

Hierarchy

% tree --charset=ascii -n

Makefile
config.mk
makefiles/
|-- include.mk
|-- local
|   |-- include.mk
|   |   |   |-- doc8
|   |   |   |    |-- doc8.ini   (alas only one --config switch allowed)
|-- [onf-make: git-submodule](https://github.com/opencord/onf-make)
|   |-- makefiles
|   |   |-- consts.mk
|   |   |-- include.mk
|   |   |-- lint
|   |   |   |-- doc8            Syntax check ReStructuredText (rst) files
|   |   |   |-- groovy
|   |   |   |-- python
|   |   |   |-- robot.mk        Syntax check robot testing framework
|   |   |   |-- shell.mk        Invoke shellcheck command on scripts
|   |   |   |-- yaml            Syntax check yaml configs

TODO

  • Refactor and merge logic from available repository makefiles/ directories.

  • Update to make use of library makefiles

    • setup.sh
    • {repository}/makefiles/{local, onf-make}/
    • Create config.mk to enable targets and features.
  • Exercise make lint targets, bulk cleanup is needed across all repositories.

  • Relocate $sandbox/config.mk into makefiles/config.mk

NOTES

  • Ascii art was rendered using

    • tree --charset=ascii -n
  • README.md can be rendered locally using

    • pandoc README.md | lynx -stdin