diff --git a/README.md b/README.md index e3747a8..77a01d7 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,10 @@ This action scans the specified `paths` for project files and checks if their fi - **Description**: Specifies the format of the output report. Options include console, csv, and json. - **Required**: No - **Default**: `console` +- **Options**: + - `console`: Prints the report to the console as a warning log message. + - `csv`: Generates a CSV file with the report. No output prints to the console. Path to the report file is provided in the `report-path` output. + - `json`: Generates a JSON file with the report. No output prints to the console. Path to the report file is provided in the `report-path` output. ### `verbose-logging` - **Description**: Enable verbose logging to provide detailed output during the action’s execution, aiding in troubleshooting and setup. @@ -56,7 +60,7 @@ This action scans the specified `paths` for project files and checks if their fi - **Description**: Count of files not complying with the specified file name patterns. ### `report-path` -- **Description**: Path to the generated report file. +- **Description**: Path to the generated report file. **Not used** if the `report-format` is set to `console`. ## Usage Example ### Default diff --git a/action.yml b/action.yml index 19acefa..f0c5e42 100644 --- a/action.yml +++ b/action.yml @@ -28,7 +28,7 @@ outputs: description: 'Count of files that do not comply with the specified file name conventions.' value: ${{ steps.scan-test-files.outputs.violation_count }} report-path: - description: 'Path to the generated report file.' + description: "Path to the generated report file. Not used when 'console' is selected as the report format." value: ${{ steps.scan-test-files.outputs.report_path }} runs: using: 'composite' diff --git a/src/filename_inspector.py b/src/filename_inspector.py index 94a502f..775bb05 100644 --- a/src/filename_inspector.py +++ b/src/filename_inspector.py @@ -71,9 +71,13 @@ def run(): set_output('violation-count', str(violation_count)) - if report_format == 'console' or verbose_logging: - logging.warning(f'Total violations: {violation_count}') - logging.warning(f'Violating files: {violations}') + if verbose_logging: + print(f'Total violations: {violation_count}') + print(f'Violating files: {violations}') + + if report_format == 'console': + logging.info(f'Total violations: {violation_count}') + logging.info(f'Violating files: {violations}') if report_format == 'csv': with open('violations.csv', mode='w', newline='') as file: @@ -92,6 +96,17 @@ def run(): logging.error(f'Action failed with error: {error}') set_failed(f'Action failed with error: {error}') +# TODO +# Inspector +# - report-path - ma ukazovat na spravny soubor a jeho cestu + +# RLS notes generator +# - set_output na set_action_output +# - set_failed na set_action_failed +# - +# - +# - + if __name__ == '__main__': run()