{"id":16908575,"url":"https://github.com/yaleman/github_linter","last_synced_at":"2025-10-29T07:19:36.201Z","repository":{"id":37068523,"uuid":"445705702","full_name":"yaleman/github_linter","owner":"yaleman","description":"Automating all the little things I need to check in my repos.","archived":false,"fork":false,"pushed_at":"2024-10-13T23:49:51.000Z","size":2157,"stargazers_count":2,"open_issues_count":20,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-14T18:51:46.300Z","etag":null,"topics":["automation","github","linter","python","shell","shellcheck","terraform"],"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/yaleman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.MD","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"yaleman","custom":["http://buymeacoffee.com/yaleman"]}},"created_at":"2022-01-08T02:33:08.000Z","updated_at":"2024-10-13T23:49:53.000Z","dependencies_parsed_at":"2023-10-03T05:29:26.437Z","dependency_job_id":"cd9f738b-3cec-41e8-9b4f-156d3ac133bb","html_url":"https://github.com/yaleman/github_linter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaleman%2Fgithub_linter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaleman%2Fgithub_linter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaleman%2Fgithub_linter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaleman%2Fgithub_linter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaleman","download_url":"https://codeload.github.com/yaleman/github_linter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243848020,"owners_count":20357482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["automation","github","linter","python","shell","shellcheck","terraform"],"created_at":"2024-10-13T18:52:00.039Z","updated_at":"2025-10-29T07:19:31.154Z","avatar_url":"https://github.com/yaleman.png","language":"Python","funding_links":["https://github.com/sponsors/yaleman","http://buymeacoffee.com/yaleman"],"categories":[],"sub_categories":[],"readme":"# github_linter\n\nThis is mainly for me, but it's a way of going through the Github repositories that you have access to, to check all the things you'd usually expect.\n\nBecause I've got like ~100 repos and keep changing how I do things, and it annoys me to work on an old one and hit all the weird edge cases I've fixed elsewhere.\n\n## Current Modules\n\n### Dependabot\n\n* Checks for a (valid-ish) config\n\n### Generic Things\n\n* Files you want gone\n* `CODEOWNERS` generation\n* generation of `.github/FUNDING`.yml\n\n### GitHub Actions\n\n* Checks for github actions tests and stuff\n\n### (GitHub) Issues\n  \n* Checks for open Issues\n* Checks for open Pull Requests\n\n### `pyproject.toml`\n\n  Only runs if you've got Python.\n\n* Checks authors based on a list.\n* Check module name matches repo\n* TODO: Check for imports, maybe?\n* Checks it exists\n* Checks for max line length configuration\n* TODO: Checks for other things (typically I disable TODO's, IE W0501)\n\n### Terraform\n\n* TODO: flesh this out\n* Checks for provider versions\n* Checks you have provider config for all your required providers.\n\n### Testing\n\n* Doesn't check for much - have moved this to github_actions\n\n### mkdocs\n\n* checks if you've got mkdocs-looking things and then makes sure you've got a github actions thing to run them\n\n## Configuration\n\nThe config file is called `github_linter.json` - you can put it in the local dir or `~/.config/github_linter.json` - I've included my configuration in the repository.\n\nEach test module has its defaults, in the `DEFAULT_CONFIG` attribute.\n\nFor an example:\n\n```python\n\u003e\u003e\u003e import github_linter.tests.pyproject\n\u003e\u003e\u003e print(github_linter.tests.pyproject.DEFAULT_CONFIG)\n{'build-system': ['flit_core.buildapi', 'poetry.core.masonry.api'], 'readme': 'README.md'}\n```\n\n### Authentication\n\n#### Using a Personal Access Token (Recommended)\n\n```json\n\"github\" : { \n    \"token\" : \"\u003cpat\u003e\"\n}\n```\n\n#### Using username/password\n\n```json\n\"github\" : { \n    \"username\" : \"\u003cyour_username\u003e\", \n    \"password\" : \"\u003cyour_password\u003e\" \n}\n```\n\n#### Set the following in your config file to bypass auth and YOLO it\n\n```json\n\"github\" : { \n    \"ignore_auth\" : true \n}\n```\n\n## Adding new test modules\n\n1. Add a module under `github_linter/tests/`\n2. Set `CATEGORY: str = \"nameofmodule\"` to a name which will go in the reports.\n3. Set `LANGUAGES: List[str] = []` to a list of lower case languages, eg: python / javascript / rust / shell / \"all\" which matches all. This is based on GitHub's auto-detection.\n4. Call check functions `check_\u003csomething\u003e`\n5. Call fix functions `fix_\u003csomething\u003e`\n6. Import the module in `tests/__init__.py` as part of the big `from . import ()` block.\n7. Eat cake.\n\n## Docker container\n\nThe container runs an entrypoint of `/bin/bash` which puts you in an environment where the package and non-dev deps are installed.\n\nThe container name to pull is `ghcr.io/yaleman/github_linter:latest`.\n\n### Building the docker container\n\nThis should auto-build with github actions (soon!) but here's a handy command:\n\n```shell\ndocker build -t 'ghcr.io/yaleman/github_linter' .\n```\n\n### Running things in the docker container\n\nRunning the web server.\n\n```shell\ndocker run --rm -it \\\n* e \"GITHUB_TOKEN=${GITHUB_TOKEN}\" \\\n* v \"$(pwd)/github_linter.json:/home/useruser/github_linter.json\" \\\n* p '8000:8000' \\\n    ghcr.io/yaleman/github_linter:latest \\\n    python -m github_linter.web\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaleman%2Fgithub_linter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaleman%2Fgithub_linter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaleman%2Fgithub_linter/lists"}