Creates an HTML-report with analysis of commit statistics
See the codeEnglish | Español | Français | Português | Deutsch | 中文 | 日本語 | 한국어 | العربية | हिन्दी | Русский
Creates an HTML-report with analysis of commit statistics:
Links: demo, online version, docker, reddit, habr
Video: english, español, русский
npx assayo./assayo/index.htmlcomposer require bakhirev/assayovendor/bin/assayo./assayo/index.htmlpipx install assayoassayo./assayo/index.htmlgem install assayoassayo./assayo/index.htmlgo get github.com/bakhirev/assayogo install github.com/bakhirev/assayoassayo./assayo/index.htmllog.txt file to the /build/build/index.html/build folder to your repository (where the log.txt is located). You can change the name. For example, from /build to /report.In this case, it is important that the log.txt file is generated by the command for offline viewing.
Add script in folder .github/workflows/ or use this action from the marketplace. A ready, fresh report will be saved in the artifacts.
dump:http://assayo_url/?dump=//you_url/some/log.txt
assayo_url - URL of the assayo container, it listens on port 80;
you_url - URL of your container with git logs;
By default, the image will run at http://127.0.0.1:80/. If it doesn't work, check if port 80 is free.
In the root directory of your project, you need to create a .mailmap file.
Example of the contents of the file:
Alex B <alex@mail.uk>
Alex B <alex@mail.uk> <alex@gov.tk>
Alex B <alex@mail.uk> <bakhirev@ya.kz>
Alex B <alex@mail.uk> <man64@yahoo.com>
Read more about the format of this file you can here.
In the root directory of your project run:
git --no-pager log --raw --numstat --oneline --all --reverse --date=iso-strict --pretty=format:"%ad>%aN>%aE>%s" > log.txt
git --no-pager log --raw --numstat --oneline --all --reverse --date=iso-strict --pretty=format:"%ad>%aN>%aE>%s" | sed -e 's/\\/\\\\/g' | sed -e 's/`/"/g' | sed -e 's/\$/S/g' | sed -e '1s/^/R(f\`/' | sed -e '$s/$/\`\);/' > log.txt
Git will create a file log.txt. This file contains data for show a report. The difference between the online and offline format is the presence of a wrapper for strings. The offline format will be pulled up like a js file if you just opened /build/index.html
By default, the output encoding may not match UTF-8 and the resulting log file will be unreadable. Before saving the log, you can change the encoding with the command.
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
Or open a saved file and manually change the encoding to UTF-8.
log.txt file (log-1.txt, log-2.txt, log-3.txt, etc.). You can do this manually, or use the Assayo Crawler module for automatic log collection;log-1.txt, log-2.txt, log-3.txt, etc.) to the report folder (/build).Follow the Conventional Commits 1.0.0. Example:
JIRA-1234 feat(profile): Added avatar for user
(JIRA-1234)(feat, fix, style, refactor, test, doc, etc.)(profile - new page on site or new function, use one (two) short word or an abbreviation)(Added avatar for user)commit-msg in folder .git/hooks/#!/usr/bin/env bash
if ! grep -iqE "(JIRA-[0-9]{1,5})(s)(feat|fix|docs|style|refactor|test|chore)((([a-z0-9_-]{1,})){0,})(:s)([a-z]{1,})" "$1"; then
echo "Need commit message like: JIRA-12 fix(profile): some text. Read Semantic Commit Messages" >&2
exit 1
fi
package.json property commit-msg:...
"commit-msg": {
"regex": "(JIRA-[0-9]{1,5})(\s)(feat|fix|docs|style|refactor|test|chore)((\([a-z0-9_-]{1,}\)){0,})(:\s)([a-z]{1,})",
"error-message": "Need commit message like: JIRA-12 fix(profile): some text Read Semantic Commit Messages"
},
...
npm install pre-commitgit clone https://github.com/bakhirev/assayo.gitnpm installnpm run build:local/build folderYou can write your own theme for the report. Example: demo
You can add a new translation or correct an existing one in the **/translations/** folder.
Instruction
The application can be customized via a configuration file. You can specify the actual configuration file in the page URL address. For example:
./assayo/index.html?config=you_custom_config.json
| Code | Type | Description | Default value |
|---|---|---|---|
| title | string | Browser tab name (document.title) | |
| logo | string | path to the logo | "./assets/logo.svg" |
| language | string | interface language | |
| languages | object[] | available languages | |
| languages[].id | string | language ID | |
| languages[].currency | string | currency | |
| languages[].title | string | language name in the interface (top right corner) | |
| urlForCss | string | path to the CSS file for overriding styles. You can create your own visual theme. Example: demo | |
| urlForGitLog | string | path to the GIT logs file | "./log.txt" |
| prefixForTask | string | prefix for task links | "https://jira.com/secure/RapidBoard.jspa?task=" |
| prefixForPR | string | prefix for Pull Request links | "https://bitbucket.com/projects/assayo/repos/frontend/pull-requests/" |
| middleSalaryInMonth | number | average salary per month in USD | 3000 |
| workDays | boolean[] | which days to consider "working", where 0 is Monday and 6 is Sunday | [true, true, true, true, true, false, false] |
| currency | string | current currency | "RUB" |
| exchangeRate | object<string, number> | exchange rate in the format "key: value", to USD. Example: { USD: 1 } | { USD: 1, EUR: 0.9, RUB: 82, CNY: 7, JPY: 160, KRW: 1500, CAD: 1.4, INR: 92, ILS: 3.1, AED: 3.6} |
| permissions | string[] | array of available permissions | |
| disabledPermissions | string[] | array of unavailable permissions | |
| plugins | string[] | array of enabled plugins | |
| disabledPlugins | string[] | array of disabled plugins |
Some parameters are used more often than others. Therefore, they can be set in the URL, without a configuration file.
| Code | Description | Example |
|---|---|---|
| title | Browser tab name (document.title) | ?title=Company_Name |
| lang | interface language | ?lang=es |
| theme | path to the CSS file for overriding styles. You can create your own visual theme. Example: demo | ?theme=//company.com/some.css |
See src\ts\helpers\ApplicationConfig\getDefaultConfig.ts
{
title: '',
logo: 'https://yousite.com/yousite.svg',
urlForCss: 'https://yousite.com/themes/white.css',
urlForGitLog: 'https://yousite.com/logs/team.txt',
prefixForTask: 'https://yousite.com/?task=',
prefixForPR: 'https://yousite.com/?pullRequests=',
middleSalaryInMonth: 4000,
currency: 'RUB',
exchangeRate: {
RUB: 90,
},
disabledPlugins: ['print'],
}
Roadmap and plans: TODO.md
HTML
52.1%
TypeScript
44.3%
SCSS
3.3%
Creates an HTML-report with analysis of commit statistics
See the codeEnglish | Español | Français | Português | Deutsch | 中文 | 日本語 | 한국어 | العربية | हिन्दी | Русский
Creates an HTML-report with analysis of commit statistics:
Links: demo, online version, docker, reddit, habr
Video: english, español, русский
npx assayo./assayo/index.htmlcomposer require bakhirev/assayovendor/bin/assayo./assayo/index.htmlpipx install assayoassayo./assayo/index.htmlgem install assayoassayo./assayo/index.htmlgo get github.com/bakhirev/assayogo install github.com/bakhirev/assayoassayo./assayo/index.htmllog.txt file to the /build/build/index.html/build folder to your repository (where the log.txt is located). You can change the name. For example, from /build to /report.In this case, it is important that the log.txt file is generated by the command for offline viewing.
Add script in folder .github/workflows/ or use this action from the marketplace. A ready, fresh report will be saved in the artifacts.
dump:http://assayo_url/?dump=//you_url/some/log.txt
assayo_url - URL of the assayo container, it listens on port 80;
you_url - URL of your container with git logs;
By default, the image will run at http://127.0.0.1:80/. If it doesn't work, check if port 80 is free.
In the root directory of your project, you need to create a .mailmap file.
Example of the contents of the file:
Alex B <alex@mail.uk>
Alex B <alex@mail.uk> <alex@gov.tk>
Alex B <alex@mail.uk> <bakhirev@ya.kz>
Alex B <alex@mail.uk> <man64@yahoo.com>
Read more about the format of this file you can here.
In the root directory of your project run:
git --no-pager log --raw --numstat --oneline --all --reverse --date=iso-strict --pretty=format:"%ad>%aN>%aE>%s" > log.txt
git --no-pager log --raw --numstat --oneline --all --reverse --date=iso-strict --pretty=format:"%ad>%aN>%aE>%s" | sed -e 's/\\/\\\\/g' | sed -e 's/`/"/g' | sed -e 's/\$/S/g' | sed -e '1s/^/R(f\`/' | sed -e '$s/$/\`\);/' > log.txt
Git will create a file log.txt. This file contains data for show a report. The difference between the online and offline format is the presence of a wrapper for strings. The offline format will be pulled up like a js file if you just opened /build/index.html
By default, the output encoding may not match UTF-8 and the resulting log file will be unreadable. Before saving the log, you can change the encoding with the command.
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
Or open a saved file and manually change the encoding to UTF-8.
log.txt file (log-1.txt, log-2.txt, log-3.txt, etc.). You can do this manually, or use the Assayo Crawler module for automatic log collection;log-1.txt, log-2.txt, log-3.txt, etc.) to the report folder (/build).Follow the Conventional Commits 1.0.0. Example:
JIRA-1234 feat(profile): Added avatar for user
(JIRA-1234)(feat, fix, style, refactor, test, doc, etc.)(profile - new page on site or new function, use one (two) short word or an abbreviation)(Added avatar for user)commit-msg in folder .git/hooks/#!/usr/bin/env bash
if ! grep -iqE "(JIRA-[0-9]{1,5})(s)(feat|fix|docs|style|refactor|test|chore)((([a-z0-9_-]{1,})){0,})(:s)([a-z]{1,})" "$1"; then
echo "Need commit message like: JIRA-12 fix(profile): some text. Read Semantic Commit Messages" >&2
exit 1
fi
package.json property commit-msg:...
"commit-msg": {
"regex": "(JIRA-[0-9]{1,5})(\s)(feat|fix|docs|style|refactor|test|chore)((\([a-z0-9_-]{1,}\)){0,})(:\s)([a-z]{1,})",
"error-message": "Need commit message like: JIRA-12 fix(profile): some text Read Semantic Commit Messages"
},
...
npm install pre-commitgit clone https://github.com/bakhirev/assayo.gitnpm installnpm run build:local/build folderYou can write your own theme for the report. Example: demo
You can add a new translation or correct an existing one in the **/translations/** folder.
Instruction
The application can be customized via a configuration file. You can specify the actual configuration file in the page URL address. For example:
./assayo/index.html?config=you_custom_config.json
| Code | Type | Description | Default value |
|---|---|---|---|
| title | string | Browser tab name (document.title) | |
| logo | string | path to the logo | "./assets/logo.svg" |
| language | string | interface language | |
| languages | object[] | available languages | |
| languages[].id | string | language ID | |
| languages[].currency | string | currency | |
| languages[].title | string | language name in the interface (top right corner) | |
| urlForCss | string | path to the CSS file for overriding styles. You can create your own visual theme. Example: demo | |
| urlForGitLog | string | path to the GIT logs file | "./log.txt" |
| prefixForTask | string | prefix for task links | "https://jira.com/secure/RapidBoard.jspa?task=" |
| prefixForPR | string | prefix for Pull Request links | "https://bitbucket.com/projects/assayo/repos/frontend/pull-requests/" |
| middleSalaryInMonth | number | average salary per month in USD | 3000 |
| workDays | boolean[] | which days to consider "working", where 0 is Monday and 6 is Sunday | [true, true, true, true, true, false, false] |
| currency | string | current currency | "RUB" |
| exchangeRate | object<string, number> | exchange rate in the format "key: value", to USD. Example: { USD: 1 } | { USD: 1, EUR: 0.9, RUB: 82, CNY: 7, JPY: 160, KRW: 1500, CAD: 1.4, INR: 92, ILS: 3.1, AED: 3.6} |
| permissions | string[] | array of available permissions | |
| disabledPermissions | string[] | array of unavailable permissions | |
| plugins | string[] | array of enabled plugins | |
| disabledPlugins | string[] | array of disabled plugins |
Some parameters are used more often than others. Therefore, they can be set in the URL, without a configuration file.
| Code | Description | Example |
|---|---|---|
| title | Browser tab name (document.title) | ?title=Company_Name |
| lang | interface language | ?lang=es |
| theme | path to the CSS file for overriding styles. You can create your own visual theme. Example: demo | ?theme=//company.com/some.css |
See src\ts\helpers\ApplicationConfig\getDefaultConfig.ts
{
title: '',
logo: 'https://yousite.com/yousite.svg',
urlForCss: 'https://yousite.com/themes/white.css',
urlForGitLog: 'https://yousite.com/logs/team.txt',
prefixForTask: 'https://yousite.com/?task=',
prefixForPR: 'https://yousite.com/?pullRequests=',
middleSalaryInMonth: 4000,
currency: 'RUB',
exchangeRate: {
RUB: 90,
},
disabledPlugins: ['print'],
}
Roadmap and plans: TODO.md
HTML
52.1%
TypeScript
44.3%
SCSS
3.3%