{"id":20480497,"url":"https://github.com/rruiter87/tcunit-precommit","last_synced_at":"2026-04-17T22:04:02.638Z","repository":{"id":244019207,"uuid":"813655965","full_name":"rruiter87/tcunit-precommit","owner":"rruiter87","description":"Pre-commit hooks for the TcUnit library","archived":false,"fork":false,"pushed_at":"2026-03-23T19:10:27.000Z","size":32,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-24T17:25:44.030Z","etag":null,"topics":["beckhoff","plc-programming","twincat3","unittest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rruiter87.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"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-06-11T13:46:23.000Z","updated_at":"2025-04-17T07:55:24.000Z","dependencies_parsed_at":"2024-12-02T22:19:10.611Z","dependency_job_id":"824903c2-08fa-412b-86dd-e6ab91b25e3d","html_url":"https://github.com/rruiter87/tcunit-precommit","commit_stats":null,"previous_names":["inspirehornets/tcunit-precommit"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/rruiter87/tcunit-precommit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rruiter87%2Ftcunit-precommit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rruiter87%2Ftcunit-precommit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rruiter87%2Ftcunit-precommit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rruiter87%2Ftcunit-precommit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rruiter87","download_url":"https://codeload.github.com/rruiter87/tcunit-precommit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rruiter87%2Ftcunit-precommit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31947762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["beckhoff","plc-programming","twincat3","unittest"],"created_at":"2024-11-15T15:50:14.387Z","updated_at":"2026-04-17T22:04:02.587Z","avatar_url":"https://github.com/rruiter87.png","language":"Python","readme":"# TcUnit pre-commit\n\nPre-commit hooks for [TcUnit](https://tcunit.org/) library.\n\nDoes this:\n\n```diff\nMETHOD TestSomethingElse\n\n-TEST('TestElse')\n+TEST('TestSomethingElse')\n...\n```\n\n## What it does\n\nThis pre-commit checks if your `METHOD` name is the same as name passed to `TEST('...')`. This is also how the [TcUnit examples](https://tcunit.org/#/introduction-user-guide?id=create-test-suites-and-run-them) are set up.\n\nYour project looks as follows:\n\n```\nMyFunction.TcPOU\nMyFunction_Tests.TcPOU\n└─ TestSomething()\n└─ TestSomethingElse()\n```\n\nWhere `TestSomething()` looks as follows:\n\n```\nMETHOD TestSomething\n\nTEST('TestSomething')\n...\n```\n\nIf your other methods looks like:\n\n```\nMETHOD TestSomethingElse\n\nTEST('TestElse')\n...\n```\n\nThen this method is flagged and optionally fixed with the `--fix` option: `TEST('TestElse')` -\u003e `TEST('TestSomethingElse')`\n\n## Usage\n\nAdd the following to your existing `.pre-commit-config.yml` file or create one.\n\n```yaml\n  - repo: https://github.com/rruiter87/tcunit-precommit\n    rev: v0.2.0\n    hooks:\n      - id: unittest-name-fixer\n        # --fix: fixes non-matching method - test names\n        args: [--fix]\n        # Only check files that end in _Tests.TcPOU, because that is how I name my tests\n        files: '.*_Tests\\.TcPOU$'\n```\n\n## Developers\n\n```bash\n# Create conda environment with necessary dependencies\nconda env create -f conda.yml\n# activate environment\nconda activate tcunit-pc312\n# Install development dependencies\npip install --requirement dev-requirements.txt\n# Install CLI in editable mode, that way any chages you make to the code are\n# directly reflected if you run unittest-name-fixer from the command line\npip install --editable .\n# Install/activate pre-commits of this repo. Assumes you have pre-commit installed globally\npre-commit install\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frruiter87%2Ftcunit-precommit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frruiter87%2Ftcunit-precommit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frruiter87%2Ftcunit-precommit/lists"}