Solving Jboss Wildfly Oracle JDBC driver problem, with Dockerfile
Assuming your web application is using oracle, and you are deploying your app on…
May 10, 2022
It is very important to introduce few process so that your code and build maintain its quality. In Python projects, two of best way is to use:
Where Pylint gives you a static analysis around python code best practices, and gives you errors around issues there. Unit-tests are always a good idea to write in your code. They keep your code in healthy state, if you are enforcing to write good number of test cases. With coverage numbers, you can restrict by how many percentage of your code should be covered.
When you run pylint
command normally on a folder or a file/module. It gives you a score. But, it does not fail anything. So, how can you put restrictions.
Pylint provides an option --fail-under
pylint --fail-under=8.0 **/*.py
Above command will give you failure, if your pylint score falls below 8.0
You can set this score as a variable in shell script as:
export warningsThresholdPylint=8.0
pylint --fail-under=${warningsThresholdPylint} **/*.py
You need to install a python module: coverage
.
This module also gives you a flag --fail-under
, below which it will fail. It checks if your code coverage percentage falls below this number.
export warningsThresholdCoverage=70
coverage run -m unittest tests/*.py
coverage report -m --fail-under=${warningsThresholdCoverage} **/*.py
We often tend to ignore these small practices which makes your build process healthy. You can put these scripts in your Jenkins pipeline, and stop build going ahead if it falls below your set standards. These are few of the best practices that we should follow in our python projects.
In next post, I will show how you can write these scripts in Jenkin pipeline groovy script.
Assuming your web application is using oracle, and you are deploying your app on…
Introduction In this guide, we will see git basic commands, and fundamentals of…
I was trying to install mongo extension with pecl. It gave me error: Then, I…
Introduction This post is about hosting MongoDB replica set cluster with…
Introduction In the ReactJS project, you are having aa parent component and a…
For programmers, who want to write about their codes. Its often the first…
Introduction In this post we will see following: How to schedule a job on cron…
Introduction There are some cases, where I need another git repository while…
Introduction In this post, we will see how to fetch multiple credentials and…
Introduction I have an automation script, that I want to run on different…
Introduction I had to write a CICD system for one of our project. I had to…
Introduction Java log4j has many ways to initialize and append the desired…