@@ -47,11 +47,11 @@ help:
47
47
@echo " logs-join to join xdist log files into one"
48
48
@echo " logs-clean to delete all xdist log files in the root"
49
49
@echo " pyc-clean to delete all temporary artifacts"
50
- @echo " uuid-check to check for duplicated @id: in testimony docstring tags"
51
- @echo " uuid-replace-empty to replace empty @id: with new generated uuid"
52
- @echo " uuid-replace-duplicate to replace duplicated @id: with new generated uuid"
50
+ @echo " uuid-check to check for duplicated or empty @id: in testimony docstring tags"
51
+ @echo " uuid-fix to fix all duplicated or empty @id: in testimony docstring tags"
53
52
@echo " can-i-push? to check if local changes are suitable to push"
54
53
@echo " install-commit-hook to install pre-commit hook to check if changes are suitable to push"
54
+ @echo " gitflake8 to check flake8 styling only for modified files"
55
55
56
56
docs :
57
57
@cd docs; $(MAKE ) html
@@ -132,26 +132,24 @@ logs-join:
132
132
logs-clean :
133
133
-rm -f robottelo_gw* .log
134
134
135
- uuid-check : # # list duplicated uuids
135
+ uuid-check : # # list duplicated or empty uuids
136
136
$(info "Checking for empty or duplicated @id: in docstrings...")
137
- scripts/check_duplicate_uuids .sh
137
+ @ scripts/check_uuids .sh
138
138
139
- uuid-replace-duplicate : # # list duplicated uuids
140
- scripts/replace_dup_uuids .sh
139
+ uuid-fix :
140
+ @ scripts/fix_uuids .sh
141
141
142
- uuid-replace-empty : # # list duplicated uuids
143
- scripts/replace_empty_uuids.sh
144
-
145
- flake8 :
142
+ gitflake8 :
146
143
$(info "Checking style and syntax errors with flake8 linter...")
147
- @flake8 . --show-source
144
+ @flake8 $( shell git diff --name-only) --show-source
148
145
149
- can-i-push? : flake8 uuid-check test-docstrings test-robottelo
146
+ can-i-push? : gitflake8 uuid-check test-docstrings test-robottelo
150
147
$(info "!!! Congratulations your changes are good to fly, make a great PR! ${USER}++ !!!")
151
148
152
149
install-commit-hook :
153
150
$(info "Installing git pre-commit hook...")
154
- echo " make can-i-push?" >> .git/hooks/pre-commit
151
+ @grep -q ' ^make uuid-fix' .git/hooks/pre-commit || echo " make uuid-fix" >> .git/hooks/pre-commit
152
+ @grep -q ' ^make can-i-push?' .git/hooks/pre-commit || echo " make can-i-push?" >> .git/hooks/pre-commit
155
153
156
154
# Special Targets -------------------------------------------------------------
157
155
@@ -161,5 +159,4 @@ install-commit-hook:
161
159
test-foreman-tier2 test-foreman-tier3 test-foreman-tier4 \
162
160
test-foreman-ui test-foreman-ui-xvfb test-foreman-endtoend \
163
161
graph-entities lint logs-join logs-clean pyc-clean \
164
- uuid-check uuid-replace-duplicate uuid-replace-empty \
165
- can-i-push? install-commit-hook
162
+ uuid-check uuid-fix can-i-push? install-commit-hook gitflake8
0 commit comments