New hooks: find-data-files to ensure that data files are not added
make-sure-hooks-synced to ensure that hooks are committed consistently to checker. Updates to README.md to document standard directories Adding Resources as standard files for all repos to consume.
This commit is contained in:
10
Hooks/scripts.d/find-data-files
Executable file
10
Hooks/scripts.d/find-data-files
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# We don't want to commit data files, with the exceptions being our GPG public key and organization logo in PNG & ASCII format.
|
||||||
|
result="$(git ls-files | xargs -n 1 file | grep -Ev ASCII\ text\|JSON\|empty\|Unicode\ text | grep -vE '^Resources/logo.png|^Resources/ascii.txt|^Resources/public.gpg')"
|
||||||
|
if [ -n "$result" ]; then
|
||||||
|
echo "These files need to be evaluated -- generally, don't commit data files to Git."
|
||||||
|
echo "$result"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
exit 0
|
4
Hooks/scripts.d/make-sure-hooks-synced
Executable file
4
Hooks/scripts.d/make-sure-hooks-synced
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
if [ `git ls-files -m | grep -E '^Hooks/scripts.d|^precommit-hooks/' | wc -l` != '0' ]; then
|
||||||
|
echo 'Hooks have changed and need to be added. Run `git add precommit-hooks`'
|
||||||
|
exit 1
|
||||||
|
fi
|
@@ -25,6 +25,14 @@ The Hooks folder includes a standard pre-commit and pre-receive that will be enf
|
|||||||
|
|
||||||
Notably, each repo that subscribes to this enforcement can also commit their own standards in addition to global standards. Python tests should go in a folder called `tests/` and scripts in a folder called `precommit-hooks/`. These will be run in addition to the global hooks.
|
Notably, each repo that subscribes to this enforcement can also commit their own standards in addition to global standards. Python tests should go in a folder called `tests/` and scripts in a folder called `precommit-hooks/`. These will be run in addition to the global hooks.
|
||||||
|
|
||||||
|
### Consumed Directories
|
||||||
|
|
||||||
|
When used with `uniglot-clone`, there are several directories at which AniNIX/Uniglot's hooks will look.
|
||||||
|
|
||||||
|
* the `rss/` directory will be used by `Hooks/scripts.d/generate-rss-snippet` on a webserver to publish snippets. See [/AniNIX/Kapisi/src/branch/main/roles/Foundation/files/custom/public/assets/js/aninix.js#L2](aninix.js#L2) for options to consume these snippets in a webpage. This allows each repo to publish new updates in one place and webpages to show it in addition to [https://singularity.aninix.net](AniNIX/Singularity) and other readers.
|
||||||
|
* The `tests/` directory will be used by `Hooks/scripts.d/pytest` to run Python unit tests on a repo. Any code should be wrapped with automated regressions.
|
||||||
|
* The `precommit-hooks` directory will be used by `Hooks/scripts.d/local-hooks`. This allows individual repos to use our general hooks and then add on specific tests on top, such as lint checkers or consistency checkers.
|
||||||
|
|
||||||
## Standard Libraries
|
## Standard Libraries
|
||||||
|
|
||||||
Each language for which we have libraries should have its own folder. Breakdown within each of these may be broken up by line count or topic, at the author's discretion. Once an include standard has been set, though, it should be preserved. For example, if functions in [the Bash header](./Bash/header) are to be broken out into subordinate files, then the Bash header should include these files that contain functions formally in itself.
|
Each language for which we have libraries should have its own folder. Breakdown within each of these may be broken up by line count or topic, at the author's discretion. Once an include standard has been set, though, it should be preserved. For example, if functions in [the Bash header](./Bash/header) are to be broken out into subordinate files, then the Bash header should include these files that contain functions formally in itself.
|
||||||
|
24
Resources/ascii.txt
Normal file
24
Resources/ascii.txt
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
...........................................
|
||||||
|
...........................................
|
||||||
|
.....................4HHH...................
|
||||||
|
..................4HHHHHHHHH................
|
||||||
|
...............4HHHHHHHHHHHHHH..............
|
||||||
|
...........4HHHHHHHH.....4HHHHHHHH...........
|
||||||
|
........4HHHHHHHH...........4HHHHHHHH........
|
||||||
|
.......4HHHHHH.................4HHHHHH.......
|
||||||
|
.......4HHHH.....................4HHHH.......
|
||||||
|
.......4HHHH....4HHH....#.........4HHHH.......
|
||||||
|
.......4HHHH....4HHH.....###......4HHHH.......
|
||||||
|
.......4HHHH....4HHH........##....4HHHH.......
|
||||||
|
.......4HHHH....4HHH........##....4HHHH.......
|
||||||
|
.......4HHHH....4HHH.....###......4HHHH.......
|
||||||
|
.......4HHHH....4HHH....#.........4HHHH.......
|
||||||
|
.......4HHHH.....................4HHHH.......
|
||||||
|
.......4HHHHHH.................4HHHHHH.......
|
||||||
|
........4HHHHHHHH...........4HHHHHHHH........
|
||||||
|
...........4HHHHHHHH......4HHHHHHHH..........
|
||||||
|
.............4HHHHHHHH.4HHHHHHHH.............
|
||||||
|
.................4HHHHHHHHHH................
|
||||||
|
....................4HHHH...................
|
||||||
|
...........................................
|
||||||
|
...........................................
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
16
Resources/public.gpg
Normal file
16
Resources/public.gpg
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
mDMEXODEBRYJKwYBBAHaRw8BAQdAfb/AxMT/BxuZ3YxVZvzGeHamqApB4Cm7mrol
|
||||||
|
N/KdMxa0MERhcmtGZWF0aGVyIDxpcmNzOi8vYW5pbml4Lm5ldDo2Njk3L0RhcmtG
|
||||||
|
ZWF0aGVyPoiQBBMWCAA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAFiEEkE3m
|
||||||
|
J1V5y1idhXIMHMHj9O0G8pYFAl4NpXUACgkQHMHj9O0G8pZGsgEAu29Fj+vDSnUF
|
||||||
|
jsDwTgSAZRSiEMIzO0hSTOL//uwaSgQA/iESpuKyfUUoteJhSvwI6PTt0D23F4AR
|
||||||
|
vXWh0f5LqTgLiJAEExYIADgWIQSQTeYnVXnLWJ2FcgwcweP07QbylgUCXg2A8QIb
|
||||||
|
AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRAcweP07QbylvaeAQDvnhvFK3Qt
|
||||||
|
BNLGwwV2w85SCm2ITFK6l4ClmO/EcreNzAEAlNHSEquQRaFwKQD7IUbj1dPllOPY
|
||||||
|
RUsFyqZetReWlAG4OARc4MQFEgorBgEEAZdVAQUBAQdA/TfytUcx/gmKbkMLF1hd
|
||||||
|
49FZIyoq2MKMrjFEHWI/KykDAQgHiHgEGBYIACACGwwWIQSQTeYnVXnLWJ2Fcgwc
|
||||||
|
weP07QbylgUCXg2ltwAKCRAcweP07Qbylo3PAP0W5BOTL8YMwLbwYzNlxFpiNSCn
|
||||||
|
GHXfxI5/3QRB8Q5kCgD+Og0Y0Nve58yZj+DkqFCpI0TJReKj+bavK7TJ9ElL8wo=
|
||||||
|
=VnrT
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
Reference in New Issue
Block a user