GithubHelp home page GithubHelp logo

mumer29 / automatically-generate-boilerplate-license-comments. Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mbrukman/autogen

0.0 0.0 0.0 227 KB

Automatically generate boilerplate license comments.

License: Apache License 2.0

Shell 77.14% Python 5.24% Emacs Lisp 5.40% Vim Script 3.85% Starlark 8.36%

automatically-generate-boilerplate-license-comments.'s Introduction

autogen

Build Status

Automatically generate boilerplate comments and code for new files with a single command.

Install

cd ~/bin
git clone [email protected]:mbrukman/autogen.git
echo 'alias autogen=~/bin/autogen/autogen' >> ~/.bash_profile
source ~/.bash_profile

Editor support

For details on adding Autogen support to your editor, please see the editors directory.

Usage

autogen -c [copyright holder] -l [license] [filename]

Modify an existing file in-place:

autogen -i [...other params as above...]

Bulk update many existing files in-place:

find . -type f -name \*.sh -exec autogen -i --no-top-level-comment [options...] {} \;

The flag --no-top-level-comment avoids adding a comment such as:

/* TODO: High-level file comment */

because either some or all of the files have such a top-level comment, or if they don't, you probably wouldn't want to have to manually add or delete at this time, if you're just trying to add the license header in bulk.

To get a list of supported licenses, or to see the full set of flags, run autogen with no parameters.

File type or language is determined based on the full filename or extension, as appropriate. See autogen for a list of recognized file types.

The flag --no-code skips adding boilerplate code to source files.

The flag --no-runline skips adding runline to source files.

Sample outputs:

Developing

To add a new file type or feature, change autogen and add several files to the tests/testdata directory, namely:

  • <feature>.in - the input file containing command-line args to pass to autogen
  • <feature>.out - expected stdout for the test
  • <feature>.err - expected stderr for the test

To generate the *.out and *.err files automatically, just add the *.in files and run regen_testdata.sh. Then, examine the resulting *.out and *.err files.

Other custom tests can be added as separate scripts in the tests directory. Add an entry for each *_test.sh script in the tests/BUILD file, including appropriate dependencies on any data files it may need.

Testing

We use Bazel for testing:

bazel test //...

Related work

Contributing

See CONTRIBUTING.md for details.

License

Apache 2.0; see LICENSE.txt for details.

Disclaimer

This project is not an official Google project. It is not supported by Google and Google specifically disclaims all warranties as to its quality, merchantability, or fitness for a particular purpose.

automatically-generate-boilerplate-license-comments.'s People

Contributors

mbrukman avatar yebrahim avatar davegwatson avatar gennadiycivil avatar grant avatar prakhar1989 avatar roest01 avatar jetpack avatar xinbenlv 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.