-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommands.sh
More file actions
48 lines (48 loc) · 1.24 KB
/
commands.sh
File metadata and controls
48 lines (48 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
sudo apt update
sudo apt install -y python3 python3-pip python3-venv git
python3 --version
git --version
pip3 --version
mkdir -p ~/precommit-lab
cd ~/precommit-lab
git init
git config user.name "Lab User"
git config user.email "labuser@example.com"
python3 -m venv venv
source venv/bin/activate
pip install pre-commit
pre-commit --version
nano app.py
nano .pre-commit-config.yaml
pre-commit install
pre-commit run --all-files
nano .flake8
nano .bandit
nano app.py
nano app_fixed.py
cp app_fixed.py app.py
pre-commit run --all-files
nano .pre-commit-config.yaml
pre-commit install
pre-commit run --all-files
nano config.json
nano config.yaml
pre-commit run --all-files
git add config.json
git add .pre-commit-config.yaml .flake8 .bandit app.py app_fixed.py config.json config.yaml
git commit -m "Add pre-commit configuration and sample files"
nano bad_code.py
git add bad_code.py
git commit -m "Test bad code"
git commit -m "Emergency commit" --no-verify
pre-commit run --all-files
ls -la .git/hooks/
cat .git/hooks/pre-commit | head -20
pre-commit autoupdate
source venv/bin/activate
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
pre-commit uninstall
pre-commit install
pre-commit run black --all-files
pre-commit run flake8 --all-files