Skip to content

Simple tool to generate PKUP report

License

Notifications You must be signed in to change notification settings

pPrecel/pkup-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Oct 28, 2023
e9bbb1a · Oct 28, 2023

History

79 Commits
Oct 18, 2023
Oct 27, 2023
Oct 28, 2023
Oct 27, 2023
Jun 20, 2023
Oct 27, 2023
Oct 27, 2023
Oct 20, 2023
Oct 27, 2023
Oct 18, 2023
Jun 20, 2023
Jun 20, 2023
Oct 28, 2023
Oct 20, 2023
Oct 20, 2023
Oct 27, 2023

Repository files navigation

.______    __  ___  __    __  .______
|   _  \  |  |/  / |  |  |  | |   _  \
|  |_)  | |  '  /  |  |  |  | |  |_)  |__ _  ___ _ __
|   ___/  |    <   |  |  |  | |   ___// _' |/ _ \ '_ \
|  |      |  .  \  |  '--'  | |  |   | (_| |  __/ | | |
| _|      |__|\__\  \______/  | _|    \__, |\___|_| |_|
                                      |___/

license build Go Report Card


Simple and easy-to-use tool to generate PKUP (Podwyższone Koszty Uzyskania Przychodu - Polish law thing) report (.docx) and artifacts (.diff).

The pkup-gen collects all users' commits pushed between the 18th (23:59:59) of the actual month and the 19th (00:00:00) of the past one. To qualify commit, the user should be an author or co-author of it.

Installation

Visit the releases page to download one of the pre-built binaries for your platform.

Homebrew

  1. Install the pkup-gen using the Homebrew:

    brew install pPrecel/tap/pkup-gen

    or

    brew tap pPrecel/tap
    brew install pkup-gen

Usage

Example usage:

screen1

For more go to the examples dir.

report

By default the pkup-gen generates the report.txt files with all info needed to fill true report.

The .docx report template can be specified using the --template flag. The pkup-gen will replace any repeat of the following key-words with the true data:

  • pkupGenPeriodFrom - date of the first day for the actual period
  • pkupGenPeriodTill - date of the last day for the actual period
  • pkupGenApprovalDate - date of the last day of the period plus one day
  • pkupGenResults - list of all PullRequests if format <PR_TITLE>( DIFF_FILE_NAME )

The pkup-gen allows to add new formula to replace in the output .docx file. It can be achieved by adding flag --report-field like in the following example:

--report-field "pkupGenEmployeesName=John Wick"

Access Token

The pkup-gen needs credentials to connect with the GitHub API. There are two possible ways to pass such credentials:

  • By default the pkup-gen will reach the pkup-gen app using the GitHub device API. The generated token will be saved on local machine so next time, until the token expires, user will be logged in. This flow is not working with the --enterprise-url flag.

  • The --token flag allows to pass a PAT. For public projects, the generated token does not need to have any permissions.