Lint and fix missing trailing newlines (#16445)
Apply the Clojure Style Guide recommendation to end files with proper lines (having a trailing newline character). See https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
This commit is contained in:
parent
8978e92042
commit
19ca8e28a5
|
@ -43,4 +43,4 @@ As a <user|developer|...>, I want to <task> so that <goal>.
|
|||
[comment]: # (if on Android please replicate bug whilst running adb logcat)
|
||||
```
|
||||
...
|
||||
```
|
||||
```
|
||||
|
|
25
Makefile
25
Makefile
|
@ -14,17 +14,17 @@ WHITE := $(shell tput -Txterm setaf 7)
|
|||
YELLOW := $(shell tput -Txterm setaf 3)
|
||||
RESET := $(shell tput -Txterm sgr0)
|
||||
HELP_FUN = \
|
||||
%help; \
|
||||
while(<>) { push @{$$help{$$2 // 'options'}}, [$$1, $$3] if /^([a-zA-Z\-]+)\s*:.*\#\#(?:@([a-zA-Z\-]+))?\s(.*)$$/ }; \
|
||||
print "Usage: make [target]\n\nSee STARTING_GUIDE.md for more info.\n\n"; \
|
||||
for (sort keys %help) { \
|
||||
print "${WHITE}$$_:${RESET}\n"; \
|
||||
for (@{$$help{$$_}}) { \
|
||||
$$sep = " " x (32 - length $$_->[0]); \
|
||||
print " ${YELLOW}$$_->[0]${RESET}$$sep${GREEN}$$_->[1]${RESET}\n"; \
|
||||
}; \
|
||||
print "\n"; \
|
||||
}
|
||||
%help; \
|
||||
while(<>) { push @{$$help{$$2 // 'options'}}, [$$1, $$3] if /^([a-zA-Z\-]+)\s*:.*\#\#(?:@([a-zA-Z\-]+))?\s(.*)$$/ }; \
|
||||
print "Usage: make [target]\n\nSee STARTING_GUIDE.md for more info.\n\n"; \
|
||||
for (sort keys %help) { \
|
||||
print "${WHITE}$$_:${RESET}\n"; \
|
||||
for (@{$$help{$$_}}) { \
|
||||
$$sep = " " x (32 - length $$_->[0]); \
|
||||
print " ${YELLOW}$$_->[0]${RESET}$$sep${GREEN}$$_->[1]${RESET}\n"; \
|
||||
}; \
|
||||
print "\n"; \
|
||||
}
|
||||
HOST_OS := $(shell uname | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
# This can come from Jenkins
|
||||
|
@ -307,6 +307,7 @@ lint: ##@test Run code style checks
|
|||
clj-kondo --config .clj-kondo/config.edn --cache false --lint src && \
|
||||
ALL_CLOJURE_FILES=$(call find_all_clojure_files) && \
|
||||
zprint '{:search-config? true}' -sfc $$ALL_CLOJURE_FILES && \
|
||||
sh scripts/lint-trailing-newline.sh && \
|
||||
yarn prettier
|
||||
|
||||
# NOTE: We run the linter twice because of https://github.com/kkinnear/zprint/issues/271
|
||||
|
@ -315,9 +316,9 @@ lint-fix: ##@test Run code style checks and fix issues
|
|||
ALL_CLOJURE_FILES=$(call find_all_clojure_files) && \
|
||||
zprint '{:search-config? true}' -sw $$ALL_CLOJURE_FILES && \
|
||||
zprint '{:search-config? true}' -sw $$ALL_CLOJURE_FILES && \
|
||||
sh scripts/lint-trailing-newline.sh --fix && \
|
||||
yarn prettier
|
||||
|
||||
|
||||
shadow-server: export TARGET := clojure
|
||||
shadow-server:##@ Start shadow-cljs in server mode for watching
|
||||
yarn shadow-cljs server
|
||||
|
|
|
@ -45,4 +45,4 @@ The `State` field in the Pivotal story is used to track the progress of a Pivota
|
|||
| 5 points | 2 - 3 days |
|
||||
| 8 points | ~1 week |
|
||||
|
||||
We should avoid 8 point stories by breaking them down into smaller stories as much as possible.
|
||||
We should avoid 8 point stories by breaking them down into smaller stories as much as possible.
|
||||
|
|
|
@ -3,4 +3,4 @@
|
|||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,4 +18,4 @@
|
|||
"url": "https://github.com/status-im/react-native-status/issues"
|
||||
},
|
||||
"homepage": "https://github.com/status-im/react-native-status#readme"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -194,4 +194,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eof pipefail
|
||||
|
||||
FILES=$(comm -23 <(sort <(git ls-files --cached --others --exclude-standard)) <(sort <(git ls-files --deleted)) | grep --ignore-case -E '\.(java|cpp|nix|json|sh|md|js|clj|cljs|cljc|edn)$')
|
||||
N_FILES=$(echo "$FILES" | wc -l)
|
||||
LINT_SHOULD_FIX=0
|
||||
|
||||
if [[ -n $1 && $1 != '--fix' ]]; then
|
||||
echo "Unknown option '$1'" >&2
|
||||
exit 1
|
||||
elif [[ $1 == '--fix' ]]; then
|
||||
LINT_SHOULD_FIX=1
|
||||
fi
|
||||
|
||||
echo "Checking ${N_FILES} files for missing trailing newlines."
|
||||
|
||||
# Do not process the whole file and only check the last character. Ignore empty
|
||||
# files. Taken from https://stackoverflow.com/a/10082466.
|
||||
for file in $FILES; do
|
||||
if [ -s "$file" ] && [ "$(tail -c1 "$file"; echo x)" != $'\nx' ]; then
|
||||
if [[ $LINT_SHOULD_FIX -eq 1 ]]; then
|
||||
echo "" >>"$file"
|
||||
else
|
||||
LINT_ERROR=1
|
||||
echo "No trailing newline: $file" >&2
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ $LINT_ERROR -eq 1 ]]; then
|
||||
exit 1
|
||||
fi
|
|
@ -11,4 +11,4 @@
|
|||
(for [i (keys icons/icons)]
|
||||
[rn/view {:flex-direction :row}
|
||||
[icons/icon (keyword i)]
|
||||
[rn/text i]])])
|
||||
[rn/text i]])])
|
||||
|
|
|
@ -26,4 +26,4 @@
|
|||
{:data [{:id 1
|
||||
:label "Item 1"}
|
||||
]} types/tab])
|
||||
(h/is-truthy (h/get-by-text "Item 1"))))
|
||||
(h/is-truthy (h/get-by-text "Item 1"))))
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
(-> message
|
||||
(clojure.set/rename-keys {:chatId :chat-id
|
||||
:introductionMessage :introduction-message
|
||||
:messageType :message-type})))
|
||||
:messageType :message-type})))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
(ns status-im.fleet.default-fleet (:require-macros [status-im.utils.slurp :refer [slurp]]))
|
||||
|
||||
(def default-fleets
|
||||
(slurp "resources/config/fleets.json"))
|
||||
(slurp "resources/config/fleets.json"))
|
||||
|
|
|
@ -28,4 +28,4 @@
|
|||
[button "conn sell" :connect-selected-card simulated-keycard/connect-selected-card]
|
||||
[button "pair" :connect-pairing-card simulated-keycard/connect-pairing-card]
|
||||
[button "disc" :disconnect-card simulated-keycard/disconnect-card]
|
||||
[button "res" :keycard-reset-state simulated-keycard/reset-state]])
|
||||
[button "res" :keycard-reset-state simulated-keycard/reset-state]])
|
||||
|
|
|
@ -11,4 +11,4 @@
|
|||
:justify-content :center
|
||||
:border-radius 2
|
||||
:width 18
|
||||
:height 18})
|
||||
:height 18})
|
||||
|
|
|
@ -30,4 +30,4 @@
|
|||
(if @error?
|
||||
[icons/icon :main-icons/cancel]
|
||||
(when-not @loaded?
|
||||
[react/activity-indicator {:animating true}]))])])))
|
||||
[react/activity-indicator {:animating true}]))])])))
|
||||
|
|
|
@ -60,4 +60,4 @@
|
|||
:android {:margin-bottom 3}
|
||||
:ios {:margin-bottom 10}})
|
||||
|
||||
(def section-header-container {})
|
||||
(def section-header-container {})
|
||||
|
|
|
@ -42,4 +42,4 @@
|
|||
[react/activity-indicator
|
||||
{:color colors/white-persist
|
||||
:animating true}]
|
||||
[icons/icon :main-icons/add {:color colors/white-persist}])]]])
|
||||
[icons/icon :main-icons/add {:color colors/white-persist}])]]])
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
(def slider (reagent/adapt-react-class Slider))
|
||||
|
||||
(def animated-slider
|
||||
(reagent/adapt-react-class (.createAnimatedComponent Animated Slider)))
|
||||
(reagent/adapt-react-class (.createAnimatedComponent Animated Slider)))
|
||||
|
|
|
@ -7,4 +7,4 @@
|
|||
56
|
||||
(if platform/iphone-x?
|
||||
84
|
||||
50)))
|
||||
50)))
|
||||
|
|
|
@ -32,4 +32,4 @@
|
|||
[react/view {:padding-horizontal 12 :padding-vertical 8}
|
||||
[react/text
|
||||
{:style {:font-weight "500" :color (if active? colors/white colors/blue) :line-height 22}}
|
||||
label]]]])
|
||||
label]]]])
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
{:color colors/gray
|
||||
:padding 24
|
||||
:line-height 22
|
||||
:font-size 15})
|
||||
:font-size 15})
|
||||
|
|
|
@ -7,4 +7,4 @@
|
|||
:border-radius 20
|
||||
:background-color colors/gray-lighter
|
||||
:align-items :center
|
||||
:justify-content :center})
|
||||
:justify-content :center})
|
||||
|
|
|
@ -1 +1 @@
|
|||
(ns status-im.ui.screens.help-center.styles)
|
||||
(ns status-im.ui.screens.help-center.styles)
|
||||
|
|
|
@ -10,4 +10,4 @@
|
|||
:justify-content :space-between})
|
||||
|
||||
(def enable-all
|
||||
{:align-self :flex-end})
|
||||
{:align-self :flex-end})
|
||||
|
|
|
@ -78,4 +78,4 @@
|
|||
(def bottom-container
|
||||
{:flex-direction :row
|
||||
:margin-horizontal 12
|
||||
:margin-vertical 15})
|
||||
:margin-vertical 15})
|
||||
|
|
|
@ -3,4 +3,4 @@
|
|||
(def share-link-button
|
||||
{:margin-top 12
|
||||
:margin-horizontal 16
|
||||
:margin-bottom 16})
|
||||
:margin-bottom 16})
|
||||
|
|
|
@ -8,4 +8,4 @@
|
|||
:right 0
|
||||
:align-items :center
|
||||
:justify-content :center
|
||||
:flex 1})
|
||||
:flex 1})
|
||||
|
|
|
@ -61,4 +61,4 @@
|
|||
:padding-left 16
|
||||
:color (if disabled? colors/black colors/white-persist)
|
||||
:padding-horizontal 16
|
||||
:padding-vertical 10})
|
||||
:padding-vertical 10})
|
||||
|
|
|
@ -26,4 +26,4 @@
|
|||
:border-radius 14
|
||||
:background-color colors/green
|
||||
:align-items :center
|
||||
:justify-content :center})
|
||||
:justify-content :center})
|
||||
|
|
|
@ -9,4 +9,4 @@
|
|||
(defn separator-dark
|
||||
[]
|
||||
{:height 1
|
||||
:background-color colors/black-transparent})
|
||||
:background-color colors/black-transparent})
|
||||
|
|
|
@ -18,4 +18,4 @@
|
|||
:style (merge
|
||||
{:width (or width 40)
|
||||
:height (or height 40)}
|
||||
image-style)}]])
|
||||
image-style)}]])
|
||||
|
|
|
@ -30,4 +30,4 @@
|
|||
:margin-bottom 12
|
||||
:align-items :center
|
||||
:justify-content :center
|
||||
:padding-horizontal 12})
|
||||
:padding-horizontal 12})
|
||||
|
|
|
@ -151,4 +151,4 @@
|
|||
|
||||
(def app-info-container
|
||||
{:flex-direction :column
|
||||
:flex 1})
|
||||
:flex 1})
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
[photo-path]
|
||||
(when-not (and (not (string/blank? photo-path))
|
||||
(string/starts-with? photo-path "contacts://"))
|
||||
{:uri photo-path}))
|
||||
{:uri photo-path}))
|
||||
|
|
|
@ -622,4 +622,4 @@
|
|||
"yoke"
|
||||
"yurt"
|
||||
"zinc"
|
||||
"zone"])
|
||||
"zone"])
|
||||
|
|
|
@ -21,4 +21,4 @@
|
|||
;; ticker on exchange networks. We handle that with `symbol-exchange` override.
|
||||
(defn exchange-symbol
|
||||
[{:keys [symbol-exchange symbol-display symbol]}]
|
||||
(clojure.core/name (or symbol-exchange symbol-display symbol)))
|
||||
(clojure.core/name (or symbol-exchange symbol-display symbol)))
|
||||
|
|
|
@ -10,4 +10,4 @@
|
|||
:accessibility-label (or accessibility-label :plus-button)
|
||||
:on-press on-press
|
||||
:customization-color customization-color}
|
||||
:i/add])
|
||||
:i/add])
|
||||
|
|
|
@ -46,4 +46,4 @@
|
|||
:border-width 1})
|
||||
|
||||
(def no-pinned-messages-text
|
||||
{:margin-top 20})
|
||||
{:margin-top 20})
|
||||
|
|
|
@ -34,4 +34,4 @@
|
|||
:pinned-by display-name
|
||||
:child [reply/quoted-message quoted-message false true]
|
||||
:timestamp-str timestamp-str
|
||||
:labels {:pinned-a-message (i18n/label :t/pinned-a-message)}}]))
|
||||
:labels {:pinned-a-message (i18n/label :t/pinned-a-message)}}]))
|
||||
|
|
|
@ -96,4 +96,4 @@
|
|||
|
||||
(defn header-online
|
||||
[]
|
||||
{:color (colors/theme-colors colors/neutral-80-opa-50 colors/white-opa-50)})
|
||||
{:color (colors/theme-colors colors/neutral-80-opa-50 colors/white-opa-50)})
|
||||
|
|
|
@ -38,4 +38,4 @@
|
|||
(reanimated/apply-animations-to-style
|
||||
(when enabled?
|
||||
{:opacity animation})
|
||||
(pinned-banner top-offset)))
|
||||
(pinned-banner top-offset)))
|
||||
|
|
|
@ -29,4 +29,4 @@
|
|||
:bookmarks/active
|
||||
:<- [:bookmarks]
|
||||
(fn [bookmarks]
|
||||
(into {} (remove #(:removed (second %)) bookmarks))))
|
||||
(into {} (remove #(:removed (second %)) bookmarks))))
|
||||
|
|
|
@ -1813,4 +1813,4 @@
|
|||
"your-recovery-phrase-description": "Esta es tu frase semilla. La usas para comprobar que esta es tu billetera. ¡Sólo la verás una vez! Escríbela en un papel y guárdala en un lugar seguro. La necesitarás si pierdes o reinstalas tu billetera.",
|
||||
"your-tip-limit": "Tu límite de propina",
|
||||
"youre-on-mobile-network": "Estás en una red móvil"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1228,4 +1228,4 @@
|
|||
"your-keys": "کلیدهای شما",
|
||||
"your-recovery-phrase": "عبارت دانه شما",
|
||||
"your-recovery-phrase-description": "این عبارت بازیابی شماست. شما از آن برای اثبات اینکه این کیف پول شماست استفاده می کنید. شما فقط همین یکبار آنرا مشاهده میکنید! آن را روی کاغذ بنویسید و در مکانی امن نگه دارید. اگر کیف پول خود را از دست بدهید یا مجددا نصب کنید، به آن نیاز خواهید داشت."
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1800,4 +1800,4 @@
|
|||
"your-recovery-phrase-description": "Ceci est votre phrase de récupération. Vous l'utilisez pour prouver qu'il s'agit de votre portefeuille. Vous ne le voyez qu'une fois! Ecrivez-le sur du papier et conservez-le dans un endroit sûr. Vous en aurez besoin si vous perdez ou réinstallez votre portefeuille.",
|
||||
"your-tip-limit": "Votre plafond des pourboires",
|
||||
"youre-on-mobile-network": "Vous êtes sur un réseau mobile"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1873,4 +1873,4 @@
|
|||
"your-recovery-phrase-description": "यह आपका बीज वाक्यांश है। आप इसका उपयोग यह साबित करने के लिए करते हैं कि यह आपका बटुआ है। आप इसे केवल एक बार देख सकते हैं! इसे कागज पर लिखकर सुरक्षित स्थान पर रख दें। यदि आप अपना बटुआ खो देते हैं या पुनः स्थापित करते हैं तो आपको इसकी आवश्यकता होगी।",
|
||||
"your-tip-limit": "आपकी टिप सीमा",
|
||||
"youre-on-mobile-network": "आप मोबाइल नेटवर्क पर हैं"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1906,4 +1906,4 @@
|
|||
"your-recovery-phrase-description": "これはあなたのシードフレーズです。ウォレットがあなたのものであることを証明するために使用します。一度だけしか見ることができません。紙に書くか安全な場所で保管してください。紛失やアプリを再インストールする際に必要になります。",
|
||||
"your-tip-limit": "チップ設定値",
|
||||
"youre-on-mobile-network": "モバイルネットワークを利用しています"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1896,4 +1896,4 @@
|
|||
"your-recovery-phrase-description": "Esta é sua frase-semente. Você a usa para provar que esta é sua carteira. Você só pode vê-la uma vez! Escreva no papel e mantenha em um lugar seguro. Você vai precisar dela se perder ou reinstalar sua carteira.",
|
||||
"your-tip-limit": "Seu limite de gorjeta",
|
||||
"youre-on-mobile-network": "Você está em uma rede móvel"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1840,4 +1840,4 @@
|
|||
"your-recovery-phrase-description": "这是您的助记词。您需要用它来证明这个钱包属于您。您只能查看一次!请将其写在纸上并保存在安全的地方。如果丢失或重新安装钱包,您将需要用到这些助记词。",
|
||||
"your-tip-limit": "您的手续费上限",
|
||||
"youre-on-mobile-network": "您正在使用移动网络"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1833,4 +1833,4 @@
|
|||
"your-recovery-phrase-description": "這是您的種子詞組,能用它來證明這是您的錢包。您只會看到一次!請將其寫在紙上,並存放在安全的地方。如果裝置遺失或想重新安裝錢包,將需要它。",
|
||||
"your-tip-limit": "您的手續費上限",
|
||||
"youre-on-mobile-network": "您正在使用行動網路"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue