{"id":27776336,"url":"https://github.com/theholyonez/python-comments-cleaner","last_synced_at":"2025-04-30T05:04:39.130Z","repository":{"id":290454000,"uuid":"974509102","full_name":"TheHolyOneZ/Python-Comments-Cleaner","owner":"TheHolyOneZ","description":"These regex patterns are **better than most VS Code or VSCodium extensions** for removing comments, as they allow for more control and precision.","archived":false,"fork":false,"pushed_at":"2025-04-28T22:23:48.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T05:04:36.291Z","etag":null,"topics":["clean-code","extension","python","python-clean-code","regex","regex-pattern"],"latest_commit_sha":null,"homepage":"","language":null,"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/TheHolyOneZ.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}},"created_at":"2025-04-28T22:22:02.000Z","updated_at":"2025-04-28T22:23:55.000Z","dependencies_parsed_at":"2025-04-28T23:36:23.615Z","dependency_job_id":"42cf1da0-964b-44d6-8c38-ec4518fc4d27","html_url":"https://github.com/TheHolyOneZ/Python-Comments-Cleaner","commit_stats":null,"previous_names":["theholyonez/python-comments-cleaner"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheHolyOneZ%2FPython-Comments-Cleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheHolyOneZ%2FPython-Comments-Cleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheHolyOneZ%2FPython-Comments-Cleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheHolyOneZ%2FPython-Comments-Cleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheHolyOneZ","download_url":"https://codeload.github.com/TheHolyOneZ/Python-Comments-Cleaner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251644841,"owners_count":21620632,"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":["clean-code","extension","python","python-clean-code","regex","regex-pattern"],"created_at":"2025-04-30T05:04:38.511Z","updated_at":"2025-04-30T05:04:39.125Z","avatar_url":"https://github.com/TheHolyOneZ.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python-Comments-Cleaner\nThese regex patterns are **better than most VS Code or VSCodium extensions** for removing comments, as they allow for more control and precision.\n\n\n\n## 1. Full-Line Comments\n\n### Regex Pattern:\n```regex\n^\\s*#.*$\n```\n\n### Description:\nDeletes entire lines that contain only comments, including those with leading spaces.\n\n---\n\n## 2. Trailing (Inline) Comments After Code\n\n### Regex Pattern:\n```regex\n(?\u003c=\\S)\\s{2,}#.*$\n```\n\n### Description:\nDeletes comments that appear after code, but only if there are **at least two spaces** before the `#`.\n\n---\n\n## 3. Strict Docstring Matching (One-Liner)\n### Regex Pattern:\n```\n\"\"\"[^\"]+\"\"\"\n```\nDescription:\nMatches strict one-line docstrings enclosed by triple quotes (\"\"\") in function definitions. This ensures it doesn't accidentally match strings or comments.\n\n---\n\n## Usage in VS Code or VSCodium \n\n1. **Open Find/Replace** (Ctrl+H)\n2. **Turn on Regex mode** (the `.*` button)\n3. **Paste the pattern in the \"Find\" field**\n4. **Leave \"Replace\" blank** (empty)\n5. **Click \"Replace All\"**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheholyonez%2Fpython-comments-cleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheholyonez%2Fpython-comments-cleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheholyonez%2Fpython-comments-cleaner/lists"}