Skip to content

Commit e09a376

Browse files
authored
Merge pull request #25 from haskell-cryptography/jdral/fix-whitespace
Add a GHA workflow that checks whitespace in Haskell files
2 parents 434ac71 + cbc93e0 commit e09a376

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+310
-223
lines changed

.github/workflows/whitespace.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Fix whitespace
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
merge_group:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
17+
defaults:
18+
run:
19+
shell: sh
20+
21+
jobs:
22+
whitespace:
23+
name: "Fix whitespace"
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 5
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v5
29+
30+
- name: Download fix-whitespace
31+
run: |
32+
curl -L -o fix-whitespace https://github.com/agda/fix-whitespace/releases/download/v0.1/fix-whitespace-0.1-linux.binary
33+
chmod a+x fix-whitespace
34+
35+
- name: Check whitespace
36+
run: |
37+
export PATH="$PWD:$PATH"
38+
CHECK=true ./scripts/format-fix-whitespace.sh

botan-bindings/src/Botan/Bindings/HOTP.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ as a mobile phone.
1818
Botan implements the HOTP and TOTP schemes from RFC 4226 and 6238.
1919
2020
Since the range of possible OTPs is quite small, applications must
21-
rate limit OTP authentication attempts to some small number per
21+
rate limit OTP authentication attempts to some small number per
2222
second. Otherwise an attacker could quickly try all 1000000 6-digit
2323
OTPs in a brief amount of time.
2424

botan-bindings/src/Botan/Bindings/Hash.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ foreign import capi safe "botan/ffi.h botan_hash_init"
105105
-> ConstPtr CChar -- ^ __hash_name__: name of the hash function, e.g., "SHA-384"
106106
-> Word32 -- ^ __flags__: should be 0 in current API revision, all other uses are reserved
107107
-- and return BOTAN_FFI_ERROR_BAD_FLAG
108-
-> IO CInt
108+
-> IO CInt
109109

110110
-- | Get the name of this hash function
111111
foreign import capi safe "botan/ffi.h botan_hash_name"

botan-bindings/src/Botan/Bindings/KDF.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pattern BOTAN_KDF_HKDF
4646
, BOTAN_KDF_SP800_56A
4747
, BOTAN_KDF_SP800_56C
4848
:: (Eq a, IsString a) => a
49-
49+
5050
-- NOTE: All KDFs take a HashName or HMAC(HashName) as an argument
5151
pattern BOTAN_KDF_HKDF = "HKDF"
5252
pattern BOTAN_KDF_HKDF_EXTRACT = "HKDF-Extract"

botan-bindings/src/Botan/Bindings/MAC.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,4 @@ foreign import capi safe "botan/ffi.h botan_mac_get_keyspec"
150150
-> Ptr CSize -- ^ __out_maximum_keylength__: if non-NULL, will be set to maximum keylength of MAC
151151
-> Ptr CSize -- ^ __out_keylength_modulo__: if non-NULL will be set to byte multiple of valid keys
152152
-> IO CInt -- ^ 0 on success, a negative value on failure
153-
153+

botan-bindings/src/Botan/Bindings/MPI.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ foreign import capi safe "botan/ffi.h botan_mp_swap"
237237
-> BotanMP -- ^ __y__
238238
-> IO CInt
239239

240-
-- | Return (base^exponent) % modulus
240+
-- | Return (base^exponent) % modulus
241241
foreign import capi safe "botan/ffi.h botan_mp_powmod"
242242
botan_mp_powmod
243243
:: BotanMP -- ^ __result__

botan-bindings/src/Botan/Bindings/PubKey/ElGamal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ foreign import capi safe "botan/ffi.h botan_privkey_load_elgamal"
5353
-> BotanMP -- ^ __p__: prime order of a Z_p group
5454
-> BotanMP -- ^ __g__: group generator
5555
-> BotanMP -- ^ __x__: public key
56-
-> IO CInt -- ^ 0 on success, a negative value on failure
56+
-> IO CInt -- ^ 0 on success, a negative value on failure

botan-bindings/src/Botan/Bindings/RNG.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ Initialize a random number generator object
4444
rng_type has the possible values:
4545
4646
- "system": system RNG
47-
47+
4848
- "user": userspace RNG
49-
49+
5050
- "user-threadsafe": userspace RNG, with internal locking
51-
51+
5252
- "rdrand": directly read RDRAND
5353
5454
Set rng_type to null to let the library choose some default.

botan-bindings/src/Botan/Bindings/TOTP.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ as a mobile phone.
1818
Botan implements the HOTP and TOTP schemes from RFC 4226 and 6238.
1919
2020
Since the range of possible OTPs is quite small, applications must
21-
rate limit OTP authentication attempts to some small number per
21+
rate limit OTP authentication attempts to some small number per
2222
second. Otherwise an attacker could quickly try all 1000000 6-digit
2323
OTPs in a brief amount of time.
2424

botan-bindings/src/Botan/Bindings/View.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type BotanViewBinFn ctx
2626
-> ConstPtr Word8 -- ^ __data__: the binary data
2727
-> CSize -- ^ __len__: the length of data in bytes
2828
-> CInt
29-
29+
3030
type BotanViewBinCallback ctx = FunPtr (BotanViewBinFn ctx)
3131

3232
-- NOTE: "Wrapper stubs can't be used with CApiFFI."

0 commit comments

Comments
 (0)