Skip to content

Commit

Permalink
Now eeschema_do reports ERC warnings as warning messages
Browse files Browse the repository at this point in the history
  • Loading branch information
set-soft committed Apr 20, 2020
1 parent 7b6d115 commit a109799
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ kicad-automation-scripts.inti-cmnb (1.1.4-1) stable; urgency=medium

* Tolerate when the $HOME/.config/kicad dir is absent
* Support missing *-lib-table in user config
* eeschema_do also reports warnings as a warning message

-- Salvador E. Tropea <[email protected]> Mon, 20 Apr 2020 16:02:40 -0300

Expand Down
10 changes: 6 additions & 4 deletions src/eeschema_do
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ def eeschema_parse_erc(erc_file, warning_as_error = False):
warnings = m.group(3)

if warning_as_error:
return int(errors) + int(warnings)
return int(errors)
return int(errors) + int(warnings), 0
return int(errors), int(warnings)

def eeschema_run_erc_schematic(erc_file, pid):

Expand Down Expand Up @@ -379,10 +379,12 @@ if __name__ == '__main__':
elif args.command == 'run_erc':
# Run ERC
erc_file = eeschema_run_erc_schematic(output_file_no_ext,eeschema_proc.pid)
errors = eeschema_parse_erc(erc_file, args.warnings_as_errors)
errors, warnings = eeschema_parse_erc(erc_file, args.warnings_as_errors)
if errors > 0:
logger.error('{} ERC errors detected'.format(errors))
logger.error(str(errors)+' ERC errors detected')
exit(-errors)
if warnings > 0:
logger.warning(str(warnings)+' ERC warnings detected')
logger.info('No errors');
eeschema_proc.terminate()
exit(0)

0 comments on commit a109799

Please sign in to comment.