Coder Social home page Coder Social logo

cmply's Introduction

cmply

PyPI version Supported Python versions PyPI downloads Licence

Installation

python3 -m pip install --upgrade cmply

Introduction

Cmply is a tool used to run a set of rules against a repository. The output will show the result of what rules fail or pass. There is provision for different levels of failures. These levels are info, warning, fail and security. The target can be a local folder or a git repository. If a git repository is specified, the local git is used with any configure authentication relative to the local system.

Usage

usage: cmply run [-h] [-r RULES] [-v] [-f] [--no-error] [-t TAGS] [-e ENV] [--output {json}] [-b BRANCH] target

positional arguments:
  target                the target folder or git repo to run the compliance check on

options:
  -h, --help            show this help message and exit
  -r RULES, --rules RULES
                        glob of rule files
  -v, --verbose         increase output verbosity
  -f, --hide-fail       hide failure out information
  --no-error            dont exit 1 if security and fails are found
  -t TAGS, --tags TAGS  project tags
  -e ENV, --env ENV     environmental variables
  --output {json}       output type
  -b BRANCH, --branch BRANCH
                        the branch to use if target is a git repo

Rule file

The rules files are YAML files with the following format:

name: sonarcube-setup   # Name your rule here
description: |          # This is a verbose description
  All projects must be registered in sonarcube
image: node:16          # Your steps are executed in this docker container
type: fail              # The type of rule info, warning, fail or security
tags:                   # A list of tags. These then matched to the tags passed in from the command line for your execution.
  - all
steps:                  # A list of commands executed. When a command has a non 0 response- the test is considered failed
  - test -f sonar-project.properties

Run using docker

To use the docker image of cmply it is important to pass through the hosts docker socket.

docker run \
    -v //var/run/docker.sock:/var/run/docker.sock
    -v ./rules:/opt/rules
    -v ./target:/opt/target
    -ti pselibas/cmply \
    run -r /opt/rules \
    /opt/target

cmply's People

Contributors

pselibas avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.