{"id":18810366,"url":"https://github.com/absaoss/filename-inspector","last_synced_at":"2026-04-16T00:32:10.825Z","repository":{"id":241116690,"uuid":"799243845","full_name":"AbsaOSS/filename-inspector","owner":"AbsaOSS","description":"The Test File Suffix Inspector GitHub Action scans test files in src/test directories to ensure naming conventions, reporting any files missing specified suffixes.","archived":false,"fork":false,"pushed_at":"2026-04-13T06:21:21.000Z","size":428,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-04-13T08:20:53.346Z","etag":null,"topics":["actions"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AbsaOSS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-11T15:00:32.000Z","updated_at":"2026-04-13T06:21:23.000Z","dependencies_parsed_at":"2024-05-22T14:32:54.319Z","dependency_job_id":"efdced51-df70-4a97-8e96-674c7751cc1b","html_url":"https://github.com/AbsaOSS/filename-inspector","commit_stats":null,"previous_names":["absaoss/test-file-suffix-inspector","absaoss/filename-inspector"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/AbsaOSS/filename-inspector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbsaOSS%2Ffilename-inspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbsaOSS%2Ffilename-inspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbsaOSS%2Ffilename-inspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbsaOSS%2Ffilename-inspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AbsaOSS","download_url":"https://codeload.github.com/AbsaOSS/filename-inspector/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbsaOSS%2Ffilename-inspector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31866301,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions"],"created_at":"2024-11-07T23:19:58.210Z","updated_at":"2026-04-16T00:32:10.795Z","avatar_url":"https://github.com/AbsaOSS.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Filename Inspector\n\n- [Description](#description)\n- [How It Works](#how-it-works)\n- [Inputs](#inputs)\n- [Outputs](#outputs)\n- [Usage Example](#usage-example)\n  - [Default](#default)\n  - [Full example](#full-example)\n- [How To Build](#how-to-build)\n- [Running Static Code Analysis](#running-static-code-analysis)\n- [Run Black Tool Locally](#run-black-tool-locally)\n- [Run mypy Tool Locally](#run-mypy-tool-locally)\n- [Running Unit Tests](#running-unit-tests)\n- [Code Coverage](#code-coverage)\n- [Run Action Locally](#run-action-locally)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Description\nThe **Filename Inspector** GitHub Action is designed to ensure naming conventions in project files within specified repository directories. It scans for project files and reports any missing specified file name patterns, helping maintain consistency and adherence to project standards. The tool is not limited to any programming language files; it scans file names and ignores extensions until they are used in filters.\n\n## How It Works\nThis action scans the specified `paths` for project files and checks if their file names fit the `name_patterns.` It reports the count of files not meeting the naming conventions, with options to fail the action if violations are found.\n\n## Inputs\n### `name-patterns`\n- **Description**: List of file name patterns that project files should fit, separated by commas. Supports [fnmatch pattern](https://docs.python.org/3/library/fnmatch.html).\n- **Required**: Yes\n- **Example**: `*UnitTest.*,*IntegrationTest.*`\n\n### `paths`\n- **Description**: List of paths to include in the scan, separated by commas. Supports the [glob pattern](https://code.visualstudio.com/docs/editor/glob-patterns).\n- **Required**: Yes\n- **Example**: `**/src/test/java/**,**/src/test/scala/**/*.txt`\n\n### `excludes`\n- **Description**: List of filenames to exclude from name-pattern checks, separated by commas. Support [fnmatch pattern](https://docs.python.org/3/library/fnmatch.html).\n- **Required**: No\n- **Default**: ``\n\n### `report-format`\n- **Description**: Specifies the format of the output report. Options include console, csv, and json.\n- **Required**: No\n- **Default**: `console`\n- **Options**:\n  - `console`: Prints the list of violated files to the console.\n  - `csv`: Generates a CSV file with the report. No printout of violated files to the console, unless verbose is enabled. Path to the report file is provided in the `report-path` output.\n  - `json`: Generates a JSON file with the report. No printout of violated files to the console, unless verbose is enabled. Path to the report file is provided in the `report-path` output.\n\n### `verbose-logging`\n- **Description**: Enable verbose logging to provide detailed output during the action’s execution, aiding in troubleshooting and setup.\n- **Required**: No\n- **Default**: `false`\n- **Note**: If workflow run in debug mode, 'verbose-logging' is set to 'true.'\n\n### `fail-on-violation`\n- **Description**: Set to true to fail the action if any convention violations are detected. Set false to continue without failure.\n- **Required**: No\n- **Default**: `false`\n\n## Outputs\n### `violation-count`\n- **Description**: Count of files not complying with the specified file name patterns.\n\n### `report-path`\n- **Description**: Path to the generated report file. **Not used** if the `report-format` is set to `console`.\n\n## Usage Example\n### Default\n```yaml\nname: Check Project Files Naming Conventions\non: [push]\njobs:\n  check_naming:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v2\n    - name: Filename Inspector Default\n      id: scan-test-files\n      uses: AbsaOSS/filename-inspector@v0.1.0\n      with:\n        name-patterns: '*UnitTest.*,*IntegrationTest.*'\n        paths: '**/src/test/java/**,**/src/test/scala/**'\n```\n\n### Full example\n```yaml\nname: Check Project Files Naming Conventions\non: [push]\njobs:\n  check_naming:\n      runs-on: ubuntu-latest\n      steps:\n        - uses: actions/checkout@v2\n\n        - name: Filename Inspector Full Custom\n          id: scan-test-files\n          uses: AbsaOSS/filename-inspector@v0.1.0\n          with:\n            name-patterns: |\n              *UnitTest.*,\n              *IntegrationTest.*\n            paths: |\n              **/src/test/java/**,\n              **/src/test/scala/**\n            excludes: |\n              src/exclude_dir/*.py,\n              tests/exclude_file.py\n            report-format: 'console'\n            verbose-logging: 'false'\n            fail-on-violation: 'false'\n```\n\n## How to build\n\nClone the repository and navigate to the project directory:\n\n```bash\ngit clone https://github.com/AbsaOSS/filename-inspector.git\ncd filename-inspector\n```\n\nInstall the dependencies:\n```bash\npip install -r requirements.txt\n```\n\n## Running Static Code Analysis\n\nThis project uses Pylint tool for static code analysis. Pylint analyses your code without actually running it. It checks for errors, enforces, coding standards, looks for code smells etc.\n\nPylint displays a global evaluation score for the code, rated out of a maximum score of 10.0. We are aiming to keep our code quality high above the score 9.5.\n\n### Set Up Python Environment\n```shell\npython3 -m venv venv\nsource venv/bin/activate\npip install -r requirements.txt\n```\n\nThis command will also install a Pylint tool, since it is listed in the project requirements.\n\n### Run Pylint\nRun Pylint on all files that are currently tracked by Git in the project.\n```shell\npylint $(git ls-files '*.py')\n```\n\nTo run Pylint on a specific file, follow the pattern `pylint \u003cpath_to_file\u003e/\u003cname_of_file\u003e.py`.\n\nExample:\n```shell\npylint ./src/filename_inspector.py\n``` \n\n## Run Black Tool Locally\nThis project uses the [Black](https://github.com/psf/black) tool for code formatting.\nBlack aims for consistency, generality, readability and reducing git diffs.\nThe coding style used can be viewed as a strict subset of PEP 8.\n\nThe project root file `pyproject.toml` defines the Black tool configuration.\nIn this project we are accepting the line length of 120 characters.\n\nFollow these steps to format your code with Black locally:\n\n### Set Up Python Environment\nFrom terminal in the root of the project, run the following command:\n\n```shell\npython3 -m venv venv\nsource venv/bin/activate\npip install -r requirements.txt\n```\n\nThis command will also install a Black tool, since it is listed in the project requirements.\n\n### Run Black\nRun Black on all files that are currently tracked by Git in the project.\n```shell\nblack $(git ls-files '*.py')\n```\n\nTo run Black on a specific file, follow the pattern `black \u003cpath_to_file\u003e/\u003cname_of_file\u003e.py`.\n\nExample:\n```shell\nblack ./src/filename_inspector.py\n``` \n\n### Expected Output\nThis is the console expected output example after running the tool:\n```\nAll done! ✨ 🍰 ✨\n1 file reformatted.\n```\n\n## Run mypy Tool Locally\n\nThis project uses the [my[py]](https://mypy.readthedocs.io/en/stable/)\ntool which is a static type checker for Python.\n\n\u003e Type checkers help ensure that you’re using variables and functions in your code correctly.\n\u003e With mypy, add type hints (PEP 484) to your Python programs,\n\u003e and mypy will warn you when you use those types incorrectly.\nmy[py] configuration is in `pyproject.toml` file.\n\nFollow these steps to format your code with my[py] locally:\n\n### Run my[py]\n\nRun my[py] on all files in the project.\n```shell\n  mypy .\n```\n\nTo run my[py] check on a specific file, follow the pattern `mypy \u003cpath_to_file\u003e/\u003cname_of_file\u003e.py --check-untyped-defs`.\n\nExample:\n```shell\n   mypy src/filename_inspector.py\n``` \n\n### Expected Output\n\nThis is the console expected output example after running the tool:\n```\nSuccess: no issues found in 1 source file\n```\n\n## Running Unit Tests\nUnit tests are written using pytest. To run the tests, use the following command:\n\n```bash\npytest\n```\n\nThis will execute all tests located in the __tests__ directory and generate a code coverage report.\n\n## Code Coverage\nCode coverage is collected using pytest-cov coverage tool. To run the tests and collect coverage information, use the following command:\n\n```bash\npytest --cov=src --cov-report html tests/\n```\nSee the coverage report on the path:\n```bash\nhtmlcov/index.html\n```\n\n## Run Action Locally\nCreate *.sh file and place it in the project root.\n```bash\n#!/bin/bash\n\n# Set environment variables based on the action inputs\nexport INPUT_NAME_PATTERNS=\"*UnitTest.*,*IntegrationTest.*\"\nexport INPUT_PATHS=\"**/src/test/java/**,**/src/test/scala/**\"\nexport INPUT_EXCLUDES=\"src/exclude_dir/*.py,tests/exclude_file.py\"\nexport INPUT_REPORT_FORMAT=\"console\"\nexport INPUT_VERBOSE_LOGGING=\"true\"\nexport INPUT_FAIL_ON_VIOLATION=\"false\"\n\n# Run the Python script\npython3 ./src/filename_inspector.py\n```\n\n\n## Contributing\nFeel free to submit issues or pull requests. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\nThis project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabsaoss%2Ffilename-inspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabsaoss%2Ffilename-inspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabsaoss%2Ffilename-inspector/lists"}