Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.
/ GITAG Public archive

A Python tool for generating HTML reports for git repositories.

Notifications You must be signed in to change notification settings

farmapromlab/GITAG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GITAG

A Python tool for generating HTML reports for git repositories.

Why use it?

Thanks to reports generated by GITAG we can inspect which parts of our application were changed and to what degree. For example, it can provide great insights about the impact of changes made between versions during regression tests.

How does it work?

  • First GITAG loads config file provided as an argument (explained below) and diffs two branches from git repository (using git diff under the hood)
  • Then, in all new or changed files, it looks for lines that match the pattern defined by regex attribute. When found it strips the line from prefix defined by start and postfix defined by end attribute. Any characters defined in ignore array are omitted. Since one file can be used in many modules we can define multiple tags for one file and divider attribute defines a separator.
  • Finally the HTML report is generated in GIT_PROJECT_PATH/gitag/report.

How to use it

python gitag.py [GIT_PROJECT_PATH] [branch_without_changes] [branch_with_changes] [config_file]

example1: python gitag.py GIT_PROJECT_PATH master rc config.json

Configuration

In order to configure GITAG we need to provide JSON config file in the following format:

{
  "languages": [
    {
      "extension": "java",
      "regex": "@Tag\\(([^\\)]+)\\)",
      "divider": ",",
      "start": "@Tag(",
      "end": ")",
      "ignore": [
        "{",
        "}"
      ]
    }
  ]
}

Next, we need to tag files in your project with a TAG defined in config. In the example above we configured GITAG to work with java files define by the extension attribute. In order to tag a file we need to define custom annotation, for example:

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Tag {
    TagType[] value();
}

Finally we need to have tagged files in our project, like this one:

@Tag({TagType.VIEW, TagType.FUNCTIONALITY})
public class Foo {
...
}

About

A Python tool for generating HTML reports for git repositories.

Resources

Stars

Watchers

Forks

Packages

No packages published