Skip to content

Commit ee866c7

Browse files
author
Alexander Rogalskiy
committed
Updates on files
1 parent bd957e4 commit ee866c7

File tree

10 files changed

+303
-37
lines changed

10 files changed

+303
-37
lines changed

.crowdin.bak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"token":"","organization":"Nullables.io","projectId":"java-patterns","baseDir":"docs","path":"."}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Run Performance Comparison
2+
3+
on:
4+
pull_request:
5+
types: [ labeled ]
6+
7+
permissions:
8+
pull-requests: write
9+
issues: write
10+
11+
concurrency:
12+
group: build-${{ github.event.pull_request.number || github.ref }}-${{github.workflow}}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build:
17+
if: ${{ github.event.label.name == 'help:run-comparisonstats' }}
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Remove run-performance-comparison label
22+
uses: actions-ecosystem/action-remove-labels@v1
23+
with:
24+
github_token: ${{ secrets.GITHUB_TOKEN }}
25+
labels: help:run-comparisonstats
26+
27+
- name: Check out code into the Go module directory
28+
uses: actions/checkout@v3
29+
30+
- name: Parse comment template into gh output
31+
id: parse-comment-template-into-gh-output
32+
working-directory: ./scripts/template
33+
run: |
34+
body=$(cat comment.txt)
35+
body="${body//'%'/'%25'}"
36+
body="${body//$'\n'/'%0A'}"
37+
body="${body//$'\r'/'%0D'}"
38+
echo ::set-output name=body::$body
39+
40+
- name: Create comment
41+
uses: peter-evans/create-or-update-comment@c9fcb64660bc90ec1cc535646af190c992007c32
42+
with:
43+
issue-number: ${{ github.event.pull_request.number }}
44+
body: "${{ steps.parse-comment-template-into-gh-output.outputs.body }}"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,6 @@ venv
6565

6666
# Env files
6767
.env
68+
69+
# Crowdin files
70+
.crowdin

README.md

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -44,34 +44,36 @@
4444
## 🎹 *Table of contents*
4545

4646
<!--ts-->
47-
* [Java Design Patterns](#java-design-patterns)
48-
* [<em>Table of contents</em>](#-table-of-contents)
49-
* [<em>Summary</em>](#-summary)
50-
* [<em>Documentation</em>](#-documentation)
51-
* [<em>Kubernetes</em>](#-kubernetes)
52-
* [<em>Statistics</em>](#-statistics)
53-
* [<em>Versioning</em>](#-versioning)
54-
* [<em>Authors</em>](#-authors)
55-
* [<em>Contributing</em>](#-contributing)
56-
* [<em>Visitor stats</em>](#-visitor-stats)
57-
* [<em>Licensing</em>](#-licensing)
58-
* [<em>Development Support</em>](#-development-support)
59-
* [<em>Acknowledgement</em>](#-acknowledgement)
60-
* [<em>OpenGraph Card</em>](#-opengraph-card)
61-
* [<em>Feeds and Podcasts</em>](#-feeds-and-podcasts)
62-
* [<em>Reddit posts</em>](#reddit-posts)
63-
* [<em>InfoWorld posts</em>](#infoworld-posts)
64-
* [<em>Let's talk posts</em>](#lets-talk-posts)
65-
* [<em>Random thoughts posts</em>](#random-thoughts-posts)
66-
* [<em>Better code posts</em>](#better-code-posts)
67-
* [<em>Inside Java posts</em>](#inside-java-posts)
68-
* [<em>Java programmer posts</em>](#java-programmer-posts)
69-
* [<em>Dreamix posts</em>](#dreamix-posts)
70-
* [<em>Plumbr posts</em>](#plumbr-posts)
71-
* [<em>Thorben Janssen posts</em>](#thorben-janssen-posts)
72-
* [<em>Redhat posts</em>](#redhat-posts)
73-
* [<em>JavaCodeGeeks posts</em>](#javacodegeeks-posts)
74-
* [<em>DevCases posts</em>](#devcases-posts)
47+
48+
- [Java Design Patterns](#java-design-patterns)
49+
- [<em>Table of contents</em>](#-table-of-contents)
50+
- [<em>Summary</em>](#-summary)
51+
- [<em>Documentation</em>](#-documentation)
52+
- [<em>Kubernetes</em>](#-kubernetes)
53+
- [<em>Statistics</em>](#-statistics)
54+
- [<em>Versioning</em>](#-versioning)
55+
- [<em>Authors</em>](#-authors)
56+
- [<em>Contributing</em>](#-contributing)
57+
- [<em>Visitor stats</em>](#-visitor-stats)
58+
- [<em>Licensing</em>](#-licensing)
59+
- [<em>Development Support</em>](#-development-support)
60+
- [<em>Acknowledgement</em>](#-acknowledgement)
61+
- [<em>OpenGraph Card</em>](#-opengraph-card)
62+
- [<em>Feeds and Podcasts</em>](#-feeds-and-podcasts)
63+
- [<em>Reddit posts</em>](#reddit-posts)
64+
- [<em>InfoWorld posts</em>](#infoworld-posts)
65+
- [<em>Let's talk posts</em>](#lets-talk-posts)
66+
- [<em>Random thoughts posts</em>](#random-thoughts-posts)
67+
- [<em>Better code posts</em>](#better-code-posts)
68+
- [<em>Inside Java posts</em>](#inside-java-posts)
69+
- [<em>Java programmer posts</em>](#java-programmer-posts)
70+
- [<em>Dreamix posts</em>](#dreamix-posts)
71+
- [<em>Plumbr posts</em>](#plumbr-posts)
72+
- [<em>Thorben Janssen posts</em>](#thorben-janssen-posts)
73+
- [<em>Redhat posts</em>](#redhat-posts)
74+
- [<em>JavaCodeGeeks posts</em>](#javacodegeeks-posts)
75+
- [<em>DevCases posts</em>](#devcases-posts)
76+
7577
<!--te-->
7678

7779
<div style="text-align: right"><a href="https://github.com/AlexRogalskiy/java-patterns#java-design-patterns"><i>(back to top)</i></a></div>

makefiles/common.mk

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,18 @@ GIT_REPO_PREFIX := $(shell git config --get remote.origin.url | tr ':.' '/'
3737
# GIT_REPO_NAME stores git repository name
3838
GIT_REPO_NAME := $(shell git config --get remote.origin.url | tr ':.' '/' | rev | cut -d '/' -f 2 | rev)
3939

40-
# SYS_HOST stores the host name
40+
# SYS_HOST stores system hostname
4141
SYS_HOST := $(shell hostname | tr '[:upper:]' '[:lower:]')
42-
# SYS_OS stores the value of uname -s.
42+
# SYS_OS stores system operating system
4343
SYS_OS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
44-
# SYS_ARCH stores the value of uname -m.
44+
# SYS_ARCH stores system architecture
4545
SYS_ARCH := $(shell uname -m | sed -e 's/x86_64/amd64/' | sed -e 's/aarch64\(_be\)\?/arm64/' | sed -e 's/\(arm\)\(64\)\?.*/\1\2/')
46-
# SYS_USER_GROUP stores user name/group
46+
# SYS_USER_GROUP stores system user name/group
4747
SYS_USER_GROUP := $(shell echo "$(UID):$(GID)")
48-
# SYS_CPU stores cpu count
48+
# SYS_CPU stores system cpu count
4949
SYS_CPU := $(shell bash $(GIT_ROOT_DIR)/scripts/read_cpus_available.sh)
50+
# SYS_LANGUAGE stores system locale
51+
SYS_LANGUAGE := $(shell locale | egrep "^LANG=" | cut -d= -f2 | cut -d_ -f1 | tr -d '"' | egrep "^[a-z]{2}$")
5052

5153
# QUIET stores silent mode
5254
QUIET := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-q)

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"description": "Java Design Patterns Documentation",
1919
"devDependencies": {
20+
"@cadolabs/crowdin-cli": "^3.0.19",
2021
"@types/node": "^17.0.21",
2122
"adr-tools": "^2.0.4",
2223
"alex": "^9.1.0",
@@ -136,8 +137,9 @@
136137
"contribs": "all-contributors",
137138
"contribs:add": "all-contributors add",
138139
"contribs:generate": "all-contributors generate && cp .all-contributorsrc ./docs/contributors.json",
139-
"crowdin-download": "yarn crowdin --config crowdin.yml download -b $(git rev-parse --abbrev-ref HEAD)",
140-
"crowdin-upload": "yarn crowdin --config crowdin.yml upload sources --auto-update -b $(git rev-parse --abbrev-ref HEAD)",
140+
"crowdin:download": "crowdin --config crowdin.yml download -b $(git rev-parse --abbrev-ref HEAD)",
141+
"crowdin:pull": "crowdin pull --skip-untranslated-strings",
142+
"crowdin:upload": "crowdin --config crowdin.yml upload sources --auto-update -b $(git rev-parse --abbrev-ref HEAD)",
141143
"deploy": "deploy-to-gh-pages --local --update site",
142144
"docker:build": "docker build -f ./distribution/docker-images/dev.Dockerfile -t $npm_package_config_image .",
143145
"docker:run": "docker run -ti --rm -v ${PWD}:/usr/src/app -e CI=1 $npm_package_config_image build --strict",

scripts/check_grammar.sh

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env bash
2+
# Copyright (C) 2022 SensibleMetrics, Inc. (http://sensiblemetrics.io/)
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# Usage example: /bin/sh ./scripts/check_license.sh
17+
18+
set -o errexit
19+
set -o nounset
20+
set -o pipefail
21+
22+
set -e
23+
24+
if ! command -v aspell > /dev/null; then
25+
echo "Missing aspell utility"
26+
elif ! aspell dump dicts | grep -qw "en$" > /dev/null ; then
27+
echo "Missing aspell English dictionary (aspell-en)"
28+
fi
29+
30+
DATAFILE=$(mktemp /tmp/aspell-strings.XXXXXXXXXX)
31+
DATAFILE_SORTED=$(mktemp /tmp/aspell-strings-sorted.XXXXXXXXXX)
32+
33+
echo "Temporary file: ${DATAFILE}"
34+
#strings ./docs > "${DATAFILE}"
35+
find ./docs -type f -exec strings {} \; | tr ' ' '\n' >> "${DATAFILE}"
36+
37+
38+
# tr delete quotes (disabled) # tr -d "'" | \
39+
# tr split key/value pairs
40+
# tr split words or paths
41+
# grep get all words 4 characters or more
42+
# sed strip out unwanted characters
43+
# grep ignore uppercase words (2 or more capitals)
44+
# grep ignore words with underscores (most likely variables)
45+
# grep ignore words with dots
46+
# awk count number of capitals by doing a replacement and showing word + count
47+
# awk only show items that have one capital max
48+
# grep another run to get rid of very short words
49+
# tr turn all words into lowercase before sorting
50+
# sort sort and only store unique words
51+
{
52+
tr '=' ' ' | \
53+
tr '/' ' ' | \
54+
grep -E "^[a-zA-Z]{4,}" | \
55+
sed -e 's/[|?#,:"\{\}\$=\(\)\;\/]//g' | \
56+
tr ' ' '\n' | \
57+
grep -E -v "^[A-Z]{2,}" | \
58+
grep -v "_" | \
59+
grep -v "\." | \
60+
awk '{print $1,gsub("[A-Z]","")}' | \
61+
awk '{if ($2 <= 1) { print $1 }}' | \
62+
grep -E "^[a-zA-Z]{4,}" | \
63+
tr '[:upper:]' '[:lower:]' | \
64+
sort --unique > "${DATAFILE_SORTED}"
65+
} < "${DATAFILE}"
66+
67+
aspell --lang=en --ignore-case --personal=./scripts/template/words-to-ignore.en.pws check "${DATAFILE_SORTED}"
68+
69+
if [ -f "${DATAFILE}" ]; then rm "${DATAFILE}"; fi
70+
if [ -f "${DATAFILE_SORTED}" ]; then rm "${DATAFILE_SORTED}"; fi

scripts/shellcheck.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ test_shell()
2626
while IFS="" read -r file
2727
do
2828
# collect all warnings
29-
shellcheck --format=checkstyle "$file" > ".shellcheck/$(basename "${file}")".log || true
29+
shellcheck --format=checkstyle --check-sourced --shell=sh "$file" > ".shellcheck/$(basename "${file}")".log || true
3030
# fail on >=error
3131
shellcheck --severity error "$file"
3232
done
@@ -45,7 +45,7 @@ test_shell_error()
4545
done
4646
}
4747

48-
if [ "$1" = "--shell" ]; then
48+
if [ "${1:-'--shell'}" = "--shell" ]; then
4949
test_shell
5050
exit 0
5151
else

scripts/template/comment-text.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
**Copy paste the msg below into a new comment and 'Comment' to trigger a run-comparisonstats job:**
2+
/run-comparisonstats
3+
exampleAppName: helm-deployment # helm-deployment, microservices, etc.
4+
exampleSrcFile: main.go # main.go, leeroy-app/app.go, etc.
5+
commentText: //per-dev-iteration-comment # go/js: //comment, python: #comment, etc.
6+
devIterations: 2 # number of dev iterations to run per binary
7+
\#mainBranchSkaffoldFlags: "--build-concurrency=0" # NOTE: only supports one flag
8+
\#thisPRSkaffoldFlags: "--build-concurrency=1" # NOTE: only supports one flag
9+
10+
\#run-comparisonstats job adds a rocket emoji to your comment within ~30 seconds if kicked off successfully (refreshing might be required to see this)
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
personal_ws-1.1 en 42
2+
atftpd
3+
backends
4+
bootloader
5+
anacrontab
6+
boelen
7+
addrwatch
8+
apachectl
9+
bashrc
10+
arpon
11+
auditctl
12+
bochs
13+
bindir
14+
auter
15+
autoremove
16+
anacron
17+
auditd
18+
bourne
19+
avira
20+
afick
21+
basename
22+
bootnodevnoexecnosuid
23+
grep
24+
autolog
25+
args
26+
auditstat
27+
addr
28+
bootctl
29+
backend
30+
authori
31+
bootinfo
32+
autoindex
33+
atftp
34+
ansible
35+
archiver
36+
blkid
37+
bsdrc
38+
automounter
39+
arpwatch
40+
auth
41+
apparmor
42+
automount
43+
bitdefender
44+
builtin
45+
busybox
46+
capitan
47+
cfagent
48+
cfengine
49+
chainname
50+
chakra
51+
changelog
52+
chargen
53+
chargen-dgram
54+
chargen-stream
55+
checksums
56+
checkupdates
57+
check-value
58+
chef-client
59+
chkconfig
60+
chkgrp
61+
chkprintcap
62+
chkrootkit
63+
chmod
64+
chown
65+
chrony
66+
chronyd
67+
ckpt
68+
clamconf
69+
clamd
70+
clamscan
71+
cmdagent
72+
cmdline
73+
conf
74+
config
75+
config-data
76+
config-uname
77+
consts
78+
control-url-append
79+
control-url-prepend
80+
control-url-protocol
81+
counttests
82+
cracklib
83+
cramfs
84+
cronjob
85+
cronjobs
86+
crontab
87+
crypttab
88+
csum
89+
cups
90+
cupsd
91+
entstat
92+
journalctl
93+
journalling
94+
kauditd
95+
kerberos
96+
ldap
97+
lgwr
98+
malware
99+
metalog
100+
passwordless
101+
prepend
102+
qemu
103+
qmail
104+
qmgr
105+
readlink
106+
readlinkbinary
107+
readonly
108+
reco
109+
reinstalling
110+
relatime
111+
symlink
112+
systemd
113+
tftp
114+
timedate
115+
todo
116+
tune2fs
117+
ulimit
118+
umask
119+
usbguard
120+
utils
121+
wget
122+
whitelist
123+
xargs
124+
xinet
125+
xntpd
126+
ypbind
127+
ypldap
128+
ypserv
129+
zcat
130+
zgrep
131+
zoneadm
132+
zypper

0 commit comments

Comments
 (0)