Package: jfaleiro.setup-headers
setup_headersAutomatic maintenance of licensing information in headers of source files.Searches a project directory tree finding all files matching a sequence ofglobpatterns (e.g.**/*.py,*.cfg,**/config/*.yml), and replaces any comments on the beginning of the file by lines from a header file, preceded by a comment marker (a prefix).The substitution does not apply to "hashbangs" (anything started by#!). These will be kept where they were originally.SeeLICENSEfor important licensing information.InstallationYou can use anypipcompliant tool:pipinstalljfaleiro.setup_headersOr something likepoetry:poetryaddjfaleiro.setup_headersIf you usepre-commita pip or poetry installation is not required. See below.ConfigurationAs of release0.0.5, with the migration to poetry,distutils.commandsis no longer supported.Since the use of poetry pluginsrequires a dependency on poetry, a massive toolset, we moved away from a build tool extension altogether. We will reconsider when and if Python's strugle with its dependency hell improves.The configuration of where license headers will be added is given in a file namedheaders.yamlby default:header:HEADERprefixes:-prefix:"#"globs:["setup_headers/**/*.py","test/**/*.py",".devcontainer/Dockerfile","Makefile"]-prefix:"##"globs:-"*.yml"-"*.yaml"-prefix:"//"globs:-".devcontainer/devcontainer.json"-prefix:";"globs:[setup.cfg,tox.ini]Eachprefixis a recognized comment character(s) on the beginning of each line in the header. Globs are apathlib.glob()pattern. Only relative patterns are allowed.The**/*comes from Python's Pathlib and indicates all matches under that directory. The pattern**will match only sub-directories, what is probablynot what you want.Create a file matching the name on theheaderwith what you want to be inserted on the beginning of all files that match theglobspattern, something like:my_awesome_project - Does something awesome

     Copyright (C) 2019 Joe Doe.

     This program is not free. You should pay lots of money to use it.
     Contact me for my paypal account.

     You should have received a copy of My Proprietary License
     along with this program.  If not, see <http://joe.doe/licenses/>.UseSetuptools CommandAs of release0.0.5, with the migration to poetry,distutils.commandsis no longer supported. See above.Command LineYou can also use the CLI for any projects that do not care or rely onsetuptools:$ adjust-license-header --help
usage: adjust-license-header [-h] [--config CONFIG] [--dry-run] [--prefix-mandatory] [files [files ...]]

positional arguments:
  files               process only files in the list (default: None)

optional arguments:
  -h, --help          show this help message and exit
  --config CONFIG     name of the YAML config file (default: headers.yaml)
  --dry-run           don't apply any changes (default: False)
  --prefix-mandatory  failure if file is not associated to a prefix (default: FalsePre-CommitFinally, the preferred way, you can keep license notices up to date atgitcommit time. Just add a.pre-commit-config.yamlto your project root:# See https://pre-commit.com for more information on pre-commit# See https://pre-commit.com/hooks.html for more hooksrepos:-repo:https://gitlab.com/jfaleiro.open/setup_headersrev:0.0.4-dev10hooks:-id:adjust-license-headerIf you usepre-commita pip or poetry installation is not required.