Contributions are welcome! If you would like to contribute, please fork the repository, make your changes, and submit a pull request.
- Node >= 18.0.0
- yarn
This will install all the tools needed to contribute
yarn
yarn build
Rebuild every time you made a change in the source and you need to test locally
When developing, run the provided tests for new additions.
# run unit tests
yarn test
To run the non-unit test, ensure you re-build the application and then run:
# run non-unit tests
yarn test:nuts
To add new coverage formats to the transformer:
- Add the format flag value to
formatOptions
insrc/helpers/constants.ts
. - Add new coverage types to
src/helpers/types.ts
including a{format}CoverageObject
type. Add the new{format}CoverageObject
type to theCoverageHandler
type underfinalize
.
export type CoverageHandler = {
processFile(
filePath: string,
fileName: string,
lines: Record<string, number>,
): void;
finalize(): SonarCoverageObject | CoberturaCoverageObject | CloverCoverageObject | LcovCoverageObject;
};
- Create a new coverage handler class in
src/handlers
with aconstructor
,processFile
andfinalize
class.- The
finalize
class should sort items in the coverage object before returning.
- The
- Add new coverage handler class to
src/handlers/getCoverageHandler.ts
. - Add new
{format}CoverageObject
type tosrc/helpers/generateReport.ts
and add anything needed to create the final report for that format. - Add new unit and non-unit tests for new format to
test/commands/acc-transformer
.