I am trying to setup Flake8 linter in bitbucket pipeline and it works but I only want to run linter on pushed files. Currently, it runs on the entire project.
There are many modules in the project which are not optimized and not planned to do it for a while.
Given below is the bitbucket-pipelines.yml.
image: python:3.7.3
pipelines:
default:
- step:
caches:
- pip
name: Check flake8
script: # Modify the commands below to build your repository.
- pip install flake8
- flake8 --max-line-length=180 --ignore=E203,W503
For instance, I have only pushed the core/util.py and need to run a linter on that file only.
I can specify the particular file as below to run on and works.
- flake8 core/util.py --max-line-length=180 --ignore=E203,W503
- Is it even possible to make it dynamic that takes all pushed files?
- Of course, multiple files can be pushed, is that even possible to configure?