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
.- 1 new test should transform the deploy command coverage JSON (
test/deploy_coverage.json
) into the new format - 1 new test should transform the test command coverage JSON (
test/test_coverage.json
) into the new format - A new baseline report for the new format should be added as
test/{format}_baseline.{ext}
- The existing baseline compare test should be updated to compare
test/{format}_baseline.{ext}
to the 2 reports created in the 2 new tests. Update and use thetest/commands/acc-transformer/normalizeCoverageReport.ts
to remove timestamps if the new format report has timestamps, i.e. Cobertura and Clover.
- 1 new test should transform the deploy command coverage JSON (