From 74e35aae111a388d4f36c3d2ad1ae611af718276 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 12 Jan 2020 18:22:26 +0100 Subject: [PATCH 1/3] remove deprecated targets from Makefile (#9729) - remove deprecated targets - ensure 1 empty line between targets Co-authored-by: Antoine GIRARD --- Makefile | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/Makefile b/Makefile index 61cab8b06d..89c3de401e 100644 --- a/Makefile +++ b/Makefile @@ -181,10 +181,6 @@ errcheck: fi errcheck $(PACKAGES) -.PHONY: lint -lint: - @echo 'make lint is depricated. Use "make revive" if you want to use the old lint tool, or "make golangci-lint" to run a complete code check.' - .PHONY: revive revive: @hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ @@ -279,7 +275,6 @@ test-mysql\#%: integrations.mysql.test generate-ini-mysql test-mysql-migration: migrations.mysql.test generate-ini-mysql GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./migrations.mysql.test - generate-ini-mysql8: sed -e 's|{{TEST_MYSQL8_HOST}}|${TEST_MYSQL8_HOST}|g' \ -e 's|{{TEST_MYSQL8_DBNAME}}|${TEST_MYSQL8_DBNAME}|g' \ @@ -299,7 +294,6 @@ test-mysql8\#%: integrations.mysql8.test generate-ini-mysql8 test-mysql8-migration: migrations.mysql8.test generate-ini-mysql8 GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql8.ini ./migrations.mysql8.test - generate-ini-pgsql: sed -e 's|{{TEST_PGSQL_HOST}}|${TEST_PGSQL_HOST}|g' \ -e 's|{{TEST_PGSQL_DBNAME}}|${TEST_PGSQL_DBNAME}|g' \ @@ -319,7 +313,6 @@ test-pgsql\#%: integrations.pgsql.test generate-ini-pgsql test-pgsql-migration: migrations.pgsql.test generate-ini-pgsql GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./migrations.pgsql.test - generate-ini-mssql: sed -e 's|{{TEST_MSSQL_HOST}}|${TEST_MSSQL_HOST}|g' \ -e 's|{{TEST_MSSQL_DBNAME}}|${TEST_MSSQL_DBNAME}|g' \ @@ -339,7 +332,6 @@ test-mssql\#%: integrations.mssql.test generate-ini-mssql test-mssql-migration: migrations.mssql.test generate-ini-mssql GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./migrations.mssql.test - .PHONY: bench-sqlite bench-sqlite: integrations.sqlite.test GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench . @@ -356,7 +348,6 @@ bench-mssql: integrations.mssql.test generate-ini-mssql bench-pgsql: integrations.pgsql.test generate-ini-pgsql GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench . - .PHONY: integration-test-coverage integration-test-coverage: integrations.cover.test generate-ini-mysql GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.cover.test -test.coverprofile=integration.coverage.out @@ -489,21 +480,6 @@ $(CSS_DEST): node_modules $(CSS_SOURCES) $(foreach file, $(filter-out web_src/less/themes/_base.less, $(wildcard web_src/less/themes/*)),npx lessc web_src/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;) npx postcss --use autoprefixer --use cssnano --no-map --replace public/css/* -.PHONY: javascripts -javascripts: - echo "'make javascripts' is deprecated, please use 'make js'" - $(MAKE) js - -.PHONY: stylesheets-check -stylesheets-check: - echo "'make stylesheets-check' is deprecated, please use 'make css'" - $(MAKE) css - -.PHONY: generate-stylesheets -generate-stylesheets: - echo "'make generate-stylesheets' is deprecated, please use 'make css'" - $(MAKE) css - .PHONY: swagger-ui swagger-ui: rm -Rf public/vendor/assets/swagger-ui From a3977a3e51417ddda8f0e7fde97b4e29d2d224f7 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 12 Jan 2020 21:53:12 +0100 Subject: [PATCH 2/3] fix webpack polyfills (#9735) webpack polyfills did not work because useBuiltIns: 'entry' expects a explicit core-js import. Changed it to 'usage' which does not require these explicit imports and polyfills based on browserslist. As a result, the built index.js now went from 128kB to 192kB. Ref: https://babeljs.io/docs/en/babel-preset-env#usebuiltins Co-authored-by: zeripath --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 7efde9503e..b53934c621 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -36,7 +36,7 @@ module.exports = { [ '@babel/preset-env', { - useBuiltIns: 'entry', + useBuiltIns: 'usage', corejs: 3, } ] From 2ecf98ed2d10aea4f1b4ba31887aa52b479c1317 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Sun, 12 Jan 2020 22:26:13 +0100 Subject: [PATCH 3/3] ci: use docker image for golangci-lint (#9737) --- .drone.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 7a844af8eb..c3a33b3950 100644 --- a/.drone.yml +++ b/.drone.yml @@ -83,13 +83,18 @@ steps: - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - go build -mod=vendor -o gitea_linux_386 # test if compatible with 32 bit + - name: golangci-lint + pull: always + image: golangci/golangci-lint:v1.22.2 + commands: + - golangci-lint run -v --timeout 5m + - name: build pull: always image: golang:1.13 commands: - curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs - make clean - - make golangci-lint - make revive - make swagger-check - make swagger-validate