Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • BIND BIND
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 571
    • Issues 571
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 101
    • Merge requests 101
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source ProjectsISC Open Source Projects
  • BINDBIND
  • Issues
  • #670
Closed
Open
Issue created Nov 08, 2018 by Michał Kępień@michalOwner

Add static code checks to CI

We could wire certain tools, e.g. Coccinelle, into CI, in order to automatically detect certain shortcomings of the code being pushed to GitLab. The subject is fairly broad and thus this is basically just a placeholder issue.

A quick example:

  1. Put the following contents into a file called unreachable.spatch.

    @@
    @@
    
        INSIST(0);
    +   ISC_UNREACHABLE();
        ... when != ISC_UNREACHABLE();
  2. Invoke spatch (part of Coccinelle) e.g. like this, from the top-level directory of a working copy of the BIND repository:

    spatch --sp-file unreachable.spatch --dir . --very-quiet

The above will output (on standard output) a patch file which can be applied to the source tree in order to ensure all occurrences of INSIST(0); are directly followed by an ISC_UNREACHABLE(); statement. In-place modification can be done with the help of the --in-place switch, etc.

Assignee
Assign to
Time tracking