Skip to content

Commit

Permalink
Merge pull request #19 from mbengit/master
Browse files Browse the repository at this point in the history
Merge changes for Red Hat UBI support
  • Loading branch information
mbengit authored May 20, 2020
2 parents 0c0ef6b + 115600e commit 6c2545e
Show file tree
Hide file tree
Showing 27 changed files with 925 additions and 957 deletions.
10 changes: 5 additions & 5 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
# Entries added for qradar start at relative-import
disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,relative-import,global-variable-not-assigned,global-statement,import-error,import-self,protected-access
# Entries added for qradar start at global-statement
disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,global-statement,missing-docstring,duplicate-code


[REPORTS]
Expand Down Expand Up @@ -117,10 +117,10 @@ include-naming-hint=no
property-classes=abc.abstractproperty

# Regular expression matching correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$
function-rgx=[a-z_][a-z0-9_]{2,40}$

# Naming hint for function names
function-name-hint=[a-z_][a-z0-9_]{2,30}$
function-name-hint=[a-z_][a-z0-9_]{2,40}$

# Regular expression matching correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$
Expand Down Expand Up @@ -194,7 +194,7 @@ max-nested-blocks=5
[FORMAT]

# Maximum number of characters on a single line.
max-line-length=100
max-line-length=120

# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
Expand Down
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ addons:

script:
- ./lint.sh && ./test.sh
- if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ -z "$TRAVIS_TAG" ] && [ "$TRAVIS_REPO_SLUG" == "ibm/qpylib"]; then sonar-scanner; fi # sonar only on non-PRs
# sonar only on non-PRs
- if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ -z "$TRAVIS_TAG" ] && [ "$TRAVIS_REPO_SLUG" == "ibm/qpylib"]; then
sonar-scanner;
fi

after_success:
- if [[ $TRAVIS_TAG ]]; then
Expand Down
36 changes: 18 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
## Contributing In General
# Contributing

To contribute code or documentation, please submit a [pull request](https://github.com/ibm/qpylib/pulls).

### Proposing new features
## Proposing new features

If you would like to implement a new feature, please [raise an issue](https://github.com/ibm/qpylib/issues)
before sending a pull request so the feature can be discussed.

### Fixing bugs
## Fixing bugs

To fix a bug, please [raise an issue](https://github.ibm.com/ibm/qpylib/issues) before sending a
pull request so it can be tracked.

### Merge approval
## Merge approval

Any change requires approval from two maintainers before it can be merged.

For a list of the maintainers, see the [MAINTAINERS](MAINTAINERS.md) page.
Any change requires approval before it can be merged.
A list of maintainers can be found on the [MAINTAINERS](MAINTAINERS.md) page.

## Legal

Each source file must include a license header for the Apache
Software License 2.0. Using the SPDX format is the simplest approach.
See existing source files for an example.
Each source file must include a license header for the Apache Software License 2.0.
Using the SPDX format is the simplest approach. See existing source files for an example.

## Setup

This project has been set up so that on your local machine you can lint, test and build in mostly the same way that Travis CI does. There are three scripts you can use:
On your local machine you can lint, test and build in mostly
the same way that Travis CI does. There are three scripts you can use:

* lint.sh
* test.sh
* build.sh
* `lint.sh`
* `test.sh`
* `build.sh`

The requirements.txt file in the project contains only those Python packages needed to supplement what is already provided by the Travis CI environment. If you want to run the lint/test/build scripts locally, you may need to install other packages, e.g. pytest and mock, into your local Python environment.
The `requirements.txt` file contains the Python packages needed to run these scripts.

## Code style

Pull requests will only be accepted if they pass the linting.
Linting can be run either on your fork through Travis CI, or locally using **lint.sh**.
Linting can be run either on your fork through Travis CI, or locally using `lint.sh`.

## Test

Pull requests will only be accepted if they pass all tests.
Tests can be run either on your fork through Travis CI, or locally using **test.sh**.
Tests can be run either on your fork through Travis CI, or locally using `test.sh`.

## Build

The output of **build.sh** is a tar.gz file containing the qpylib package. You can use `pip install` to install the package into your Python environment.
The output of `build.sh` is a tar.gz file containing the qpylib Python package.
You can use `pip install` to install the package into your Python 3 environment.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@

# QRadar App Python Library (qpylib)

QPyLib provides a library of Python utility functions to assist in developing QRadar applications.
A library of Python utility functions to assist in developing QRadar applications
by providing a simplified interface to the QRadar App Framework and REST API.

The utility functions ensure compatibility with QRadar and provide a simplified interface to the QRadar REST API and App Framework.
## Compatibility

The qpylib library hosted here is for use only with apps that have been written in
Python 3 to run on Red Hat Universal Base Image. It is not compatible with apps
written to run on a CentOS base image.

**NOTE**: until the first official qpylib release, planned for early Q3 2020,
any code contained herein is unsupported and subject to change.

## Project details

* [LICENSE](LICENSE)
* [CONTRIBUTING](CONTRIBUTING.md)
* [MAINTAINERS](MAINTAINERS.md)
* [CHANGELOG](CHANGELOG.md)

## Getting started

See Setup section in [CONTRIBUTING](CONTRIBUTING.md#Setup).
2 changes: 1 addition & 1 deletion clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ rm -rf .pytest_cache
rm -f qpylib/version.py
rm -rf dist qpylib.egg-info
rm -rf qpylib/__pycache__
rm -rf "test/__pycache__"
rm -rf test/__pycache__
3 changes: 2 additions & 1 deletion lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
#
# SPDX-License-Identifier: Apache-2.0

python -m pylint -d C,R -r n --rcfile=.pylintrc qpylib test/*.py
python -m pylint --version
python -m pylint -r n --rcfile=.pylintrc qpylib test/*.py
Loading

0 comments on commit 6c2545e

Please sign in to comment.