Skip to content

Commit

Permalink
Replaced yapf with black (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Burmak committed Jul 23, 2023
1 parent bb72ef4 commit ae475cc
Show file tree
Hide file tree
Showing 115 changed files with 5,856 additions and 3,735 deletions.
16 changes: 9 additions & 7 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[flake8]
; ignoring the checks:
; E122 (continuation line missing indentation or outdented),
; E126 (continuation line over-indented for hanging indent),
; E131 (continuation line unaligned for hanging indent) as indentation is responsibility of yapf
; F401 (module imported but unused) in favor of corresponding pylint check
; Disabling the checks that conflict with "black" and "pylint":
; E122 "continuation line missing indentation or outdented"
; E126 "continuation line over-indented for hanging indent"
; E131 "continuation line unaligned for hanging indent"
; E203 "whitespace before ':'"
; E501 "line too long (129 > 120 characters)"
; W503 "line break before binary operator"
; F401 "module imported but unused"
select = E,F,W,C,S
ignore = E122,E126,E131,F401
max-line-length = 120
ignore = E122,E126,E131,E203,E501,W503,F401
4 changes: 2 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
cache: pip
- name: "lint: isort"
run: make isort
- name: "lint: yapf"
run: make yapf
- name: "lint: black"
run: make black
- name: "lint: flake8"
run: make flake8
- name: "lint: pylint"
Expand Down
4 changes: 4 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[settings]
profile=black
src_paths=ch_backup tests
known_first_party=ch_backup
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ confidence=
# --disable=W"
# TODO: exclude similarities below after old pipeline removing
disable=broad-except,no-self-use,bad-continuation,too-few-public-methods,inconsistent-return-statements,
fixme,unnecessary-pass,raise-missing-from,similarities
fixme,unnecessary-pass,raise-missing-from,similarities,line-too-long


[REPORTS]
Expand Down
179 changes: 0 additions & 179 deletions .style.yapf

This file was deleted.

20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ build: install-deps ch_backup/version.txt
all: build lint test-unit test-integration

.PHONY: lint
lint: install-deps isort yapf flake8 pylint mypy bandit
lint: install-deps isort black flake8 pylint mypy bandit

.PHONY: isort
isort: install-deps
${TEST_ENV} isort --check-only --ignore-whitespace --diff ch_backup tests
${TEST_ENV} isort --check --diff .

.PHONY: yapf
yapf: install-deps
${TEST_ENV} yapf -rpd ch_backup tests
.PHONY: black
black: install-deps
${TEST_ENV} black --check --diff .

.PHONY: flake8
flake8: install-deps
Expand Down Expand Up @@ -144,8 +144,8 @@ clean_env: stop_env

.PHONY: format
format: install-deps
${TEST_ENV} isort ch_backup tests
${TEST_ENV} yapf --recursive --parallel --in-place ch_backup tests
${TEST_ENV} isort .
${TEST_ENV} black .


ch_backup/version.txt:
Expand All @@ -166,11 +166,11 @@ help:
@echo "Targets:"
@echo " build (default) Build project. It installs dependencies and generates version.txt."
@echo " all Alias for \"build lint test-unit test-integration\"."
@echo " lint Run all linter tools. Alias for \"isort yapf flake8 pylint mypy bandit\"."
@echo " lint Run all linter tools. Alias for \"isort black flake8 pylint mypy bandit\"."
@echo " test-unit Run unit tests."
@echo " test-integration Run integration tests."
@echo " isort Perform isort checks."
@echo " yapf Perform yapf checks."
@echo " black Perform black checks."
@echo " flake8 Perform flake8 checks."
@echo " pylint Perform pylint checks."
@echo " mypy Perform mypy checks.."
Expand All @@ -184,7 +184,7 @@ help:
@echo " clean_debuild Clean up build and test artifacts including ones produced by"
@echo " debuild target outside the project worksapce."
@echo " format Re-format source code to conform style settings enforced by"
@echo " isort and yapf tools."
@echo " isort and black tools."
@echo " help Show this help message."
@echo
@echo "Environment Variables:"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Commands:

### Regression

The regression test suite contains run of static code analysis tools (isort, yapf, flake8, pylint, mypy, bandit),
The regression test suite contains run of static code analysis tools (isort, black, flake8, pylint, mypy, bandit),
unit tests and integration tests.

The tests can be run by issuing the command:
Expand Down
Loading

0 comments on commit ae475cc

Please sign in to comment.