Page MenuHomeSealhub

Jak ustawić linting i unit testy zintegrowane z Sealhubem
Updated 298 Days AgoPublic

Ten artykuł zawiera instrukcje stawiania lintowania za pomocą ESLinta, testów funkcjonalnych i integracji obydwu tych procesów z arcanistem i phabricatorem.

Zakładamy, że repozytorium, w którym wdrażane jest lintowanie, korzysta z Typescripta.

Instalacja arcanista i linterów

mkdir -p ~/bin
cd ~/bin
git clone https://hub.sealcode.org/diffusion/118/arcanist-fork.git arcanist
git clone https://hub.sealcode.org/diffusion/124/arcanist-linters.git
git clone https://github.com/sealcode/arc-unit-mocha.git
ln -s arcanist/bin/arc arc

# Dodaj ~/bin do swojego PATH, jeżeli jeszcze go tam nie ma:

echo "export PATH=\$PATH:$HOME/bin" >> ~/.bashrc
echo "export PATH=\$PATH:$HOME/bin" >> ~/.zshrc

# zrestartuj terminal i sprawdź, czy ta komenda:

which arc

# zwraca: /home/<nazwa_usera>/bin/arc
# jeżeli zwraca coś innego, np. /usr/bin/arc, to odinstaluj wersję arcanista, jaką masz zainstalowaną z managera paczek

Dodawanie lintera do nowego repo

Jeżeli tworzysz własne repo, podążaj za poniższymi instrukcjami. Jeżeli nie, to zignoruj poniższe instrukcje.

Dodaj takie pliki do repo projektu:

https://hub.sealcode.org/diffusion/PLAY/browse/hotwire/.arclint
https://hub.sealcode.org/diffusion/PLAY/browse/hotwire/.arcconfig
https://hub.sealcode.org/diffusion/PLAY/browse/hotwire/.eslintrc.js

Dodaj depsy:

npm install --save-dev prettier eslint @typescript-eslint/eslint-plugin eslint-plugin-prettier@latest eslint-config-prettier eslint-plugin-prettier

Od teraz możesz sprawdzić wynik lintowania za pomocą:

arc lint

Dodatkowo, wyniki lintowania będą się wyświetlały w diffie, ułatwiając zadnaie recenzentom i autorom diffów

Last Author
kuba-orlik
Last Edited
Aug 8 2022, 08:34

Event Timeline

kuba-orlik edited the content of this document. (Show Details)Jul 21 2020, 11:55
kuba-orlik created this object.
kuba-orlik edited the content of this document. (Show Details)Jul 21 2020, 12:00
kuba-orlik edited the content of this document. (Show Details)Jul 21 2020, 13:20
kuba-orlik edited the content of this document. (Show Details)Jul 21 2020, 20:37
kuba-orlik edited the content of this document. (Show Details)Jul 22 2020, 14:55
kuba-orlik edited the content of this document. (Show Details)Jul 22 2020, 15:23
kuba-orlik edited the content of this document. (Show Details)Jul 30 2020, 12:26
kuba-orlik edited the content of this document. (Show Details)
piotr-ptaszynski edited the content of this document. (Show Details)Sep 3 2020, 17:30
piotr-ptaszynski edited the content of this document. (Show Details)
piotr-ptaszynski edited the content of this document. (Show Details)
piotr-ptaszynski edited the content of this document. (Show Details)Sep 3 2020, 17:39
kuba-orlik edited the content of this document. (Show Details)Dec 10 2020, 12:15
kuba-orlik edited the content of this document. (Show Details)Dec 10 2020, 12:17
kuba-orlik edited the content of this document. (Show Details)
kuba-orlik edited the content of this document. (Show Details)
kuba-orlik edited the content of this document. (Show Details)Dec 16 2020, 14:01

Dodałem te pluginy do AUR, więc jak ktoś korzysta z Archa to może sobie je pobrać.

Więc w moim przypadku instrukcja wygląda następująco

yay -S arcanist arcanist-linters-git arc-unit-mocha-git

a aktualizacja jest normalnie przez

yay

@kuba-orlik

@fraunos najs! 💪 Dodasz to do treści powyższego artykułu, aby nie umknęło?

fraunos edited the content of this document. (Show Details)Jan 17 2021, 18:05
fraunos edited the content of this document. (Show Details)Jan 24 2021, 03:11
kuba-orlik edited the content of this document. (Show Details)Mar 7 2021, 18:20
kuba-orlik edited the content of this document. (Show Details)
kuba-orlik edited the content of this document. (Show Details)Mar 7 2021, 18:28
kuba-orlik edited the content of this document. (Show Details)
kuba-orlik edited the content of this document. (Show Details)
kuba-orlik edited the content of this document. (Show Details)Mar 7 2021, 18:34
kuba-orlik edited the content of this document. (Show Details)
kuba-orlik edited the content of this document. (Show Details)
kuba-orlik edited the content of this document. (Show Details)Jun 15 2021, 17:22
kuba-orlik edited the content of this document. (Show Details)Jul 7 2022, 08:56
kuba-orlik edited the content of this document. (Show Details)
kuba-orlik edited the content of this document. (Show Details)Aug 8 2022, 08:34