Metadata-Version: 2.1
Name: kicad2junit
Version: 0.1.4
Summary: Convert KiCad ERC/DRC report to Junit reports
Author: Gustav Palmqvist
Author-email: gustavp@gpa-robotics.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Utilities
Requires-Dist: dataclasses-json (>=0.5,<0.6)
Requires-Dist: junit-xml (>=1.9,<2.0)
Requires-Dist: typed-argument-parser (>=1.8.1,<2.0.0)
Description-Content-Type: text/markdown

# kicad2junit

A utility to convert KiCad DRC/ERC reports to Junit reports for CI/CD checks.

# Usage

## DRC
```
usage: drc2junit [-h] [--project [PROJECT]] [--project-dir PROJECT_DIR] [--warn-error] [input] [output]

Convert KiCad DRC report to JUnit

positional arguments:
  input                 JSON DRC report
  output                JUnit XML output

options:
  -h, --help            show this help message and exit
  --project [PROJECT]   Kicad project file
  --project-dir PROJECT_DIR
                        Kicad project directory
  --warn-error          Treat warnings as errors
```

### Example
```sh
kicad-cli pcb drc /tmp/drc.json --format json
drc2junit /tmp/drc.json drc.junit.xml --project /path/to/project.kicad_pro
```

## ERC
```
usage: erc2junit [-h] [--project [PROJECT]] [--project-dir PROJECT_DIR] [--warn-error] [input] [output]

Convert KiCad ERC report to JUnit

positional arguments:
  input                 JSON ERC report
  output                JUnit XML output

options:
  -h, --help            show this help message and exit
  --project [PROJECT]   Kicad project file
  --project-dir PROJECT_DIR
                        Kicad project directory
  --warn-error          Treat warnings as errors
```

### Usage
```sh
kicad-cli sch erc /tmp/erc.json --format json
erc2junit /tmp/erc.json erc.junit.xml --project /path/to/project.kicad_pro
```

## Exit code
The exit code is set to 1 (Failure) if one or more errors are found (and warnings if `--warn-error` is used).


