{"id":13734552,"url":"https://github.com/plinss/flake8-noqa","last_synced_at":"2025-04-09T15:05:42.003Z","repository":{"id":40328002,"uuid":"270392855","full_name":"plinss/flake8-noqa","owner":"plinss","description":"flake8 plugin to validate #noqa comments - Mirror of https://gitlab.linss.com/open-source/flake8/flake8-noqa","archived":false,"fork":false,"pushed_at":"2024-01-06T03:48:08.000Z","size":63,"stargazers_count":41,"open_issues_count":9,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-09T15:05:36.779Z","etag":null,"topics":["flake8","flake8-extension","flake8-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plinss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.LESSER","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}},"created_at":"2020-06-07T18:17:50.000Z","updated_at":"2024-09-30T01:19:01.000Z","dependencies_parsed_at":"2024-01-06T04:41:34.554Z","dependency_job_id":null,"html_url":"https://github.com/plinss/flake8-noqa","commit_stats":{"total_commits":35,"total_committers":3,"mean_commits":"11.666666666666666","dds":"0.11428571428571432","last_synced_commit":"96577399165432b72dbb4b28049d273df595f264"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinss%2Fflake8-noqa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinss%2Fflake8-noqa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinss%2Fflake8-noqa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plinss%2Fflake8-noqa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plinss","download_url":"https://codeload.github.com/plinss/flake8-noqa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055284,"owners_count":21040157,"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":["flake8","flake8-extension","flake8-plugin"],"created_at":"2024-08-03T03:00:57.323Z","updated_at":"2025-04-09T15:05:41.980Z","avatar_url":"https://github.com/plinss.png","language":"Python","readme":"[flake8-noqa](https://github.com/plinss/flake8-noqa)\n==========\n\nflake8 plugin to validate `# noqa` comments.\n\nflake8 is very particular about formatting of `# noqa` comments.\nIf your `# noqa` isn't exactly what flake8 expects,\nit can easily cause your `# noqa` comment to be ignored.\n\nHowever, forgetting a colon or adding an extra space in the wrong place\nwill turn a strict `# noqa: \u003ccode\u003e` comment\ninto a blanket `# noqa` comment,\nwhich is likely not what you intended.\nFor example:\n`# noqa F841`,\n`# noqa : F841`,\nand `# noqa:  F841`\nwill be interpreted as `# noqa`\nand may, as a result,\nhide other errors you care about.\n\nThis plugin looks for noqa comments\nthat do not match the proper formatting\nso your `# noqa` comments work and do only what you expect them to.\n\nOptionally, it can also enforce usage of codes with all `# noqa` comments.\n\nIn addition, this plugin looks for `# noqa` comments that are unnecessary\nbecause either there are no matching violations on the line\nor they contain codes that do not match existing violations.\n\nErrors reported by this module cannot be prevented via `# noqa` comments,\notherwise you'd never see many of the errors it produces.\nUse `ignore`, `extend-ignore`, or `per-file-ignores` to ignore them as needed.\nAlternatively, if you have a comment that this plugin thinks is a\n`# noqa` with codes,\nbut isn't,\ne.g. `# noqa : X100 is not a code`,\nyou can make the comment look less like a proper `# noqa` comment.\ne.g. `# noqa - X100 is not a code`\n(flake8 will interpret both of those as `# noqa`).\n\nUsage Note:\nWhen determining if violations have matched a `# noqa` comment,\nthis plugin requires flake8 to have been made aware of the violations\nthat would otherwise apply.\nSome plugins do their own processing of `# noqa` comments \nand stop sending violation reports to flake8 when they see a `# noqa` comment.\nA plugin doing so will cause this plugin to stop seeing the violation,\nand it may report the lack of a violation or matching code.\nWhen you then remove the `# noqa` comment or violation code, \nthe other plugin will resume sending the violation,\nprompting you to restore the `# noqa` comment or code.\n\nThe best fix for this situation is to try to get the offending plugin\nto stop respecting `# noqa` comments.\nA plugin doing so is considered an anti-pattern,\nand it's best to allow flake8 to determine if violations should be \nsurfaced to the user or not.\nThe offending plugin may have an option to control this behavior\n(note the flake8 `--disable-noqa` option will disable *all* noqa comments,\nso is not a suitable fix for this situation).\nIf the plugin does not have an option to control its `# noqa` behavior, \nthe best course of action may be to contact the maintainers of \nthe plugin via the appropriate issue reporting system.\n\nIf the plugin is unmaintained,\nor the maintainers decline to address the issue for whatever reason,\nfeel free to file an issue on this plugin\nto see if a work-around can be established.\n\n\nInstallation\n------------\n\nStandard python package installation:\n\n    pip install flake8-noqa\n\n\nOptions\n-------\n`noqa-require-code`\n: Require code(s) to be included in  `# noqa` comments\n\n`noqa-no-require-code`\n: Do not require code(s) in `# noqa` comments (default setting)\n\n`noqa-include-name`\n: Include plugin name in messages\n\n`noqa-no-include-name`\n: Do not include plugin name in messages (default setting)\n\nAll options may be specified on the command line with a `--` prefix,\nor can be placed in your flake8 config file.\n\n\nError Codes\n-----------\n\n| Code   | Message |\n|--------|---------|\n| NQA001 | \"`#noqa`\" must have a single space after the hash, e.g. \"`# noqa`\" |\n| NQA002 | \"`# noqa X000`\" must have a colon, e.g. \"`# noqa: X000`\" |\n| NQA003 | \"`# noqa : X000`\" must not have a space before the colon, e.g. \"# noqa: X000\"' |\n| NQA004 | \"\u003ccode\u003e# noqa:\u0026nbsp;\u0026nbsp;X000\u003c/code\u003e\" must have at most one space before the codes, e.g. \"`# noqa: X000`\" |\n| NQA005 | \"`# noqa: X000, X000`\" has duplicate codes, remove X000 |\n| NQA011 | \"`#flake8: noqa`\" must have a single space after the hash, e.g. \"`# flake8: noqa`\" |\n| NQA012 | \"`# flake8 noqa`\" must have a colon or equals, e.g. \"`# flake8: noqa`\" |\n| NQA013 | \"`# flake8 : noqa`\" must not have a space before the colon, e.g. \"# flake8: noqa\" |\n| NQA101 | \"`# noqa`\" has no violations |\n| NQA102 | \"`# noqa: X000`\" has no matching violations |\n| NQA103 | \"`# noqa: X000, X001`\" has unmatched code(s), remove X001 |\n| NQA104 | \"`# noqa`\" must have codes, e.g. \"`# noqa: X000`\" (enable via `noqa-require-code`) |\n\n\nExamples\n--------\n\n```\n#flake8 noqa   \u003c-- ignored (NQA011)\nx = 1+2  #noqa  \u003c-- ignored (NQA001)\nx = 1+2  # noqa E226  \u003c-- treated as a blanket noqa (NQA002)\nx = 1+2  # noqa : E226  \u003c-- treated as a blanket noqa (NQA003)\nx = 1+2  # noqa:  E226  \u003c-- treated as a blanket noqa (NQA004)\nx = 1+2 # noqa: X101, E261 \u003c-- unmatched code (NQA103)\n```\n","funding_links":[],"categories":["Comments"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplinss%2Fflake8-noqa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplinss%2Fflake8-noqa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplinss%2Fflake8-noqa/lists"}