-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from plone/maurits-modernize
Modernize, remove outdated code, add code-analysis checks
- Loading branch information
Showing
50 changed files
with
1,908 additions
and
2,083 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Code Analysis | ||
on: | ||
push: | ||
|
||
jobs: | ||
code-analysis: | ||
name: Code analysis | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout codebase | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run check isort | ||
uses: plone/code-analysis-action@v1 | ||
with: | ||
check: 'isort' | ||
path: | | ||
plone | ||
setup.py | ||
- name: Run check black | ||
uses: plone/code-analysis-action@v1 | ||
with: | ||
check: 'black' | ||
path: | | ||
plone | ||
setup.py | ||
- name: Run check flake8 | ||
uses: plone/code-analysis-action@v1 | ||
with: | ||
check: 'flake8' | ||
path: | | ||
plone | ||
setup.py | ||
- name: Run check pyroma | ||
uses: plone/code-analysis-action@v1 | ||
with: | ||
check: 'pyroma' | ||
path: | | ||
./ | ||
- name: Run check zpretty | ||
uses: plone/code-analysis-action@v1 | ||
with: | ||
check: 'zpretty' | ||
path: | | ||
plone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
### Defensive settings for make: | ||
# https://tech.davis-hansson.com/p/make/ | ||
SHELL:=bash | ||
.ONESHELL: | ||
.SHELLFLAGS:=-xeu -o pipefail -O inherit_errexit -c | ||
.SILENT: | ||
.DELETE_ON_ERROR: | ||
MAKEFLAGS+=--warn-undefined-variables | ||
MAKEFLAGS+=--no-builtin-rules | ||
|
||
# We like colors | ||
# From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects | ||
RED=`tput setaf 1` | ||
GREEN=`tput setaf 2` | ||
RESET=`tput sgr0` | ||
YELLOW=`tput setaf 3` | ||
|
||
CODE_QUALITY_VERSION=1.0.1 | ||
LINT=docker run --rm -v "$(PWD)":/github/workspace plone/code-quality:${CODE_QUALITY_VERSION} check | ||
FORMAT=docker run --rm -v "$(PWD)":/github/workspace plone/code-quality:${CODE_QUALITY_VERSION} format | ||
|
||
PACKAGE_NAME=plone.dexterity | ||
PACKAGE_PATH=plone/ | ||
CHECK_PATH=setup.py $(PACKAGE_PATH) | ||
|
||
# Add the following 'help' target to your Makefile | ||
# And add help text after each target name starting with '\#\#' | ||
.PHONY: help | ||
help: ## This help message | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
.PHONY: format | ||
format: ## Format the codebase according to our standards | ||
$(FORMAT) "$(CHECK_PATH)" | ||
|
||
.PHONY: lint | ||
lint: ## validate with isort, black, flake8, pyroma, zpretty | ||
# Would be nice to have a way to run all available checks, instead of specifying them here. | ||
$(LINT) isort "$(CHECK_PATH)" | ||
$(LINT) black "$(CHECK_PATH)" | ||
$(LINT) flake8 "$(CHECK_PATH)" | ||
$(LINT) pyroma . | ||
$(LINT) zpretty "$(PACKAGE_PATH)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Python 3.7+ only, drop Python 2 support. | ||
[jensens, maurits] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Remove long deprecated imports and fallbacks. | ||
[jensens, maurits] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Use Bootstrap 5 classes for buttons. | ||
[jensens] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
# -*- coding: utf-8 -*- | ||
__import__("pkg_resources").declare_namespace(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
# Kick dynamic module factory | ||
from . import schema # noqa |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
# -*- coding: utf-8 -*- | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.