optittm / bugprediction

A CLI tool to assess the risk of releasing your next version. Can generate a comprehensive dataset for testing your bug prediction models.
MIT License
0 stars 1 forks source link

Support for complex include/exclude rules #27

Closed bbalet closed 1 year ago

bbalet commented 1 year ago

Many projects having a long history have changed their code organization over time. For example Spring-boot splitted their inital repository in various separate github projects. Or RxJava had their source folder in "./rxjava-core/src", but now in "./src".

It would be nice to have the following env variables:

OTTM_EXCLUDE_FOLDERS
OTTM_INCLUDE_FOLDERS

To support a simple comma-separated list of folders and something more complex as well.

For example an alternative JSON structure that supports expression language or a rule based on semVer (this is just an example I didn't check the git history of this project):

OTTM_INCLUDE_FOLDERS = { "<=0.11.2": "rxjava-core/src", ">=2.0.0": "src" }

With this value we get three scenarios:

  1. For versions between the start and 0.11.2, "./rxjava-core/src" will be the only folder included
  2. For versions strictly greater than 0.11.2 and lesser than 2.0.0 there will be no filter
  3. From version 0.11.2 on, "./src" will be the only folder included

This would result in a faster analysis and greater accuracy of models.

See: https://semver.org/ https://python-semver.readthedocs.io/en/latest/usage/compare-versions.html