Skip to content
forked from mbrukman/autogen

Automatically generate boilerplate license comments.

License

Notifications You must be signed in to change notification settings

yebrahim/autogen

Repository files navigation

Build Status

autogen

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

Usage:

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

Modify an existing file in-place:

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

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

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

Sample outputs:

Editor support

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

Developing

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

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

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

Other custom tests can be added as separate scripts in the tests directory. If the file has the suffix _tests.sh, it will be automatically picked up by tests/run_all_tests.sh script, which means that make test will automatically run it without any other changes.

Be sure to also add an entry for it in tests/BUILD file for Bazel to be able to run it as well, including appropriate dependencies on any data files it may need.

Testing

You have two options:

  • via Bazel: bazel test //...
  • via Make: make test

Bazel is typically faster, especially when rerunning tests, due to built-in caching.

License

Apache 2.0; see LICENSE.txt for details.

About

Automatically generate boilerplate license comments.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 53.1%
  • Python 17.7%
  • Ruby 13.5%
  • Perl 5.7%
  • Emacs Lisp 3.7%
  • Vim Script 2.7%
  • Other 3.6%