Skip to main content

The project copyright linter

Project description

Project copyright linter

A small utility to maintain the copyright status of a project in the correct state.

Copyright format

  • Python copyright format:
# Copyright (c) 20XX Celadon Development LLC, All rights reserved.
# Author Name Surname <name.surname@celadon.ae>
  • JavaScript copyright format:
// Copyright (c) 20XX Celadon Development LLC, All rights reserved.
// Author Name Surname <name.surname@celadon.ae>

Installation

  • install package via pip toolkit: pip install crtool
  • configure utility use one of two available methods
  • run the project copyright linting: crtool

Configuration

Configuration settings are applied in two ways: by setup.cfg file or .crlintrc file. The setup.cfg file has more high priority. To set an exclusion pattern to ignore some file formats, use a unix pattern written in one of the files you selected.

  • configuration utility in the setup.cfg file must have such format:
[crlint]
patterns=*.json, *.txt
  • configuration utility in the .crlintrc file must have such format:
[ignore]
patterns=*.json, *.txt

Integration with Bitbucket CI:

Add such step in your bitbucket-pipelines.yml file to run checking a project copyright:

pipelines:
  default:
    - step:
        name: Linting copyright
        image: python:3.7.2
        script:
          - pip install crtool
          - crlint

Update pip package

  • Login to the PiPy repository
  • Increase version in the setup file
  • Create a python package dist
  • Update package on the PyPi repository
# Create a package dist.
python setup.py sdist bdist_wheel

# Upload package to repository.
pip install twine
twine upload -u $CT_PYPI_USERNAME -p $CT_PYPI_PASSWORD  dist/*

Development

Setup git hook to linting the project before commit.

chmod a+x pre-commit && cp pre-commit .git/hooks

To run the test and verify the code, follow the commands below:

# To run the project linting.
flake8 crlint tests

# To run the project testing.
python -m coverage run -m unittest discover tests/
python -m coverage report -m

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for crlint, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size crlint-0.1.2-py3-none-any.whl (7.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size crlint-0.1.2.tar.gz (5.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page