Coder Social home page Coder Social logo

medarion / copyright Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jdelasoie/copyright

0.0 0.0 0.0 66 KB

Add or replace license boilerplate. (Python)

License: GNU General Public License v3.0

Makefile 0.61% Python 59.73% Shell 6.74% Perl 0.94% Java 3.19% JavaScript 1.39% HTML 2.98% C++ 23.64% TSQL 0.78%

copyright's Introduction

Overview

Add or replace license/copyright boilerplate in source code files.

All contiguous comment blocks (bounded by empty or code lines) that contain a copyright message are stripped before injecting the new message.

You should commit all your code into a repo before running this program and check the results with a diff utility.

Features

  • Autodetect language from extension or shebang or header.
  • Force programming language to use if files cannot be autodetected.
  • Specify list of files to process.
  • Recursive or non-recursive processing from current or specific path.
  • Custom templates loadable from a JSON file.
  • Specify author(s), year(s), program and short description.
  • Include or exclude files or directories with wildcards or regex.
  • Append to file or insert after any contiguous header comment block.
  • Control left-hand margin padding and newline spacing.
  • JSON config file ingestion for repeated or automated use, overridden by command-line options.
  • Multi or single line comment style, such as /* */ vs. //.
  • Quiet mode to suppress printing of altered files.
  • Languages currently supported: C/C++, Java, HTML, Shell/Bash/Csh/Ksh/Tcsh/Zsh, Perl, Python, SQL, XML
  • Python 2 and 3.

Examples

Process current directory recursively and autodetect files.

$ copyright -c config.json

Process files matching wildcards, appending to end of file.

$ copyright -a 'Joe Smith' -p MyApp -l mit -i '*.py,foo*.h,script?' --back

Use custom template.

$ copyright -c config.json -t my_templates.json --license my-license-2.0

Installation

With PyPI.

$ pip install copyright

With tarball.

$ python setup.py install

Testing

$ make test

FAQ

Q1. How can you keep multiple licenses in a file?
A1. One strategy is to create a custom templates file that has all the licenses merged into one key/value pair, and then process your specific list of files.

News

1.0.1.0

  • Added -q/--quiet mode.
  • Fixed -v/--version message.

1.0.0.0

  • Initial release.

License

copyright Copyright (C) 2016 Remik Ziemlinski

This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the conditions of the GPLv3 license.

copyright's People

Contributors

dbishop avatar orion avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.