Skip to content

Conversation

@kilo52
Copy link
Member

@kilo52 kilo52 commented Jan 28, 2026

Adds the --stop-on-error CLI option.

Adds an option to stop the process as soon as the first error is encountered. Without the option, some errors might get ignored. For example, when a source file contains syntax errors and thus the logical line count cannot be computed, the scount will skip that file and continue normally with the rest of the files to process. With the --stop-on-error option specified on the command-line, the process stops when the file with a syntax error is encountered and the processed RcnCountStatistics struct is flagged as erroneous.

Renames the files inside the 'mixedWithSyntaxError' test resource directory to have the erroneous source files placed in the middle, as scanned files are always sorted by libreckon. Adjusts other tests accordingly.

Changes internal count() implementation in libreckon to copy the erroneous state to the RcnCountStatistics struct being processed so that it is available to the caller.

Added an option to stop the process as soon as the first error is encountered.
Without the option, some errors might get ignored. For example, when a source
file contains syntax errors and thus the logical line count cannot be computed,
the scount will skip that file and continue normally with the rest of the files
to process. With the --stop-on-error option specified on the command-line, the
process stops when the file with a syntax error is encountered and the
processed RcnCountStatistics struct is flagged as erroneous.

Renamed the files inside the 'mixedWithSyntaxError' test resource directory to
have the erroneous source files placed in the middle, as scanned files are
always sorted by libreckon. Adjusted other tests accordingly.

Changed internal count() implementation in libreckon to copy the erroneous
state to the RcnCountStatistics struct being processed so that it is available
to the caller.

Signed-off-by: kilo52 <phil.gaiser@raven-computing.com>
@kilo52 kilo52 self-assigned this Jan 28, 2026
@kilo52 kilo52 added the Feature New feature label Jan 28, 2026
@kilo52 kilo52 linked an issue Jan 28, 2026 that may be closed by this pull request
Signed-off-by: kilo52 <phil.gaiser@raven-computing.com>
Signed-off-by: kilo52 <phil.gaiser@raven-computing.com>
Signed-off-by: kilo52 <phil.gaiser@raven-computing.com>
@kilo52 kilo52 merged commit 91c3a5b into master Jan 30, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Option to scount to Stop on Error

2 participants