# flake8-copyright-validator
Flake8 plugin for validating copyright text in python files.
___
## Installation
```shell
pip install flake8-copyright-validator
````
## How to use
In your config file like _setup.cfg_ under flake8 specify _copyright-text_ wrapping every string with `'`.
```
[flake8]
copyright-text = 'Example copyright text'
```
### Available flags
* `--update` If difference or lack of copyright was found in file writes copyright text at the beginning of python
file.
If specified, value of bytes-to-read is ignored. Careful with this option if your header is incorrect it will add one
more on top of wrong header.
* `--bytes-to-read` If your copyright takes more than 2048 bytes or you want to load less text specify this value
* `--detailed-output` Provides detailed output with flake8 error
* `--lines-to-exclude` Files with first line containing value from lines to exclude will not be checked for copyright.
Lines to exclude is not a comma separated list. It's a text that is split by end of line (\n).
* `--symbols-to-replace` You can wrap your copyright text with symbols, by default it is `'`, it is used for
specifying
copyright text that starts with `#`. You can change it if you don't need it with this flag. It is comma separated
list.
## How it works
Plugin splits copyright text by end of line (\n), and reads 2048 bytes of file by default.
If differences were found it yields `NCF100 No copyright found`.
Plugin does not use comma separated lists for text
## Complete example of _setup.cfg_
```
[flake8]
lines-to-exclude =
'# Generated by Django'
'#!'
copyright-text =
'# Example - Example'
'# Copyright (C) Example'
'#'
'# This program is free software: you can redistribute it and/or modify'
'# it under the terms of the GNU Affero General Public License as published'
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Umaaz/flake8-copyright-validator",
"name": "flake8-header-validator",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Ben Donnelly",
"author_email": "b.w.donnelly1@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/02/4a/e8d9f869f660f7d9d19bb550ce4d7572251e94d30208b00542d09495f1bb/flake8-header-validator-0.0.3.tar.gz",
"platform": null,
"description": "# flake8-copyright-validator\n\nFlake8 plugin for validating copyright text in python files.\n___\n\n## Installation\n\n```shell\npip install flake8-copyright-validator\n````\n\n## How to use\n\nIn your config file like _setup.cfg_ under flake8 specify _copyright-text_ wrapping every string with `'`.\n\n```\n[flake8]\ncopyright-text = 'Example copyright text'\n```\n\n### Available flags\n\n* `--update` If difference or lack of copyright was found in file writes copyright text at the beginning of python\n file. \n If specified, value of bytes-to-read is ignored. Careful with this option if your header is incorrect it will add one\n more on top of wrong header.\n* `--bytes-to-read` If your copyright takes more than 2048 bytes or you want to load less text specify this value\n* `--detailed-output` Provides detailed output with flake8 error\n* `--lines-to-exclude` Files with first line containing value from lines to exclude will not be checked for copyright. \n Lines to exclude is not a comma separated list. It's a text that is split by end of line (\\n).\n* `--symbols-to-replace` You can wrap your copyright text with symbols, by default it is `'`, it is used for\n specifying \n copyright text that starts with `#`. You can change it if you don't need it with this flag. It is comma separated\n list.\n\n## How it works\n\nPlugin splits copyright text by end of line (\\n), and reads 2048 bytes of file by default. \nIf differences were found it yields `NCF100 No copyright found`. \nPlugin does not use comma separated lists for text\n\n## Complete example of _setup.cfg_\n\n```\n[flake8]\nlines-to-exclude =\n '# Generated by Django'\n '#!'\n\ncopyright-text = \n '# Example - Example'\n '# Copyright (C) Example'\n '#'\n '# This program is free software: you can redistribute it and/or modify'\n '# it under the terms of the GNU Affero General Public License as published'\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Check if python file contain copyright text",
"version": "0.0.3",
"project_urls": {
"Homepage": "https://github.com/Umaaz/flake8-copyright-validator"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d13faa088f79e0f04c00a3cd169df4d33e21ceb4ffac29bf26e7c57a11738c1d",
"md5": "471206d228812b0e319f956b7aadd052",
"sha256": "603202750c0fdb293028de9462687a0a18ecde148182a55874406535b857d1c1"
},
"downloads": -1,
"filename": "flake8_header_validator-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "471206d228812b0e319f956b7aadd052",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 4865,
"upload_time": "2024-01-16T11:32:10",
"upload_time_iso_8601": "2024-01-16T11:32:10.519464Z",
"url": "https://files.pythonhosted.org/packages/d1/3f/aa088f79e0f04c00a3cd169df4d33e21ceb4ffac29bf26e7c57a11738c1d/flake8_header_validator-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "024ae8d9f869f660f7d9d19bb550ce4d7572251e94d30208b00542d09495f1bb",
"md5": "7155f2c61c2a5d6b4e736142c7513fa6",
"sha256": "b7e9ab1e9f40f19ba1b731e1acbe7aa9e30d6717ac79486d2568bd4a09b12e08"
},
"downloads": -1,
"filename": "flake8-header-validator-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "7155f2c61c2a5d6b4e736142c7513fa6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 4337,
"upload_time": "2024-01-16T11:32:11",
"upload_time_iso_8601": "2024-01-16T11:32:11.476513Z",
"url": "https://files.pythonhosted.org/packages/02/4a/e8d9f869f660f7d9d19bb550ce4d7572251e94d30208b00542d09495f1bb/flake8-header-validator-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-16 11:32:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Umaaz",
"github_project": "flake8-copyright-validator",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "flake8-header-validator"
}