Skip to content

Commit

Permalink
Merge pull request #48 from hostinger/feat/merge-upstream-2.31
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'upstream/master' into feat/merge-upstream-2.31
  • Loading branch information
laurynasgadl authored Nov 12, 2024
2 parents 70731b4 + a086a3b commit a81c251
Show file tree
Hide file tree
Showing 233 changed files with 15,194 additions and 9,121 deletions.
32 changes: 11 additions & 21 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,51 +13,41 @@ jobs:
lint-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: make lint-frontend
lint-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.0
go-version: 1.23.0
- run: make lint-backend
lint-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '18'
- run: make lint-commits
lint:
runs-on: ubuntu-latest
needs: [lint-frontend, lint-backend, lint-commits]
needs: [lint-frontend, lint-backend]
steps:
- run: echo "done"

# tests
test-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: make test-frontend
test-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.0
go-version: 1.23.0
- run: make test-backend
test:
runs-on: ubuntu-latest
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/pr-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Lint PR"

on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize

permissions:
pull-requests: write

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
Details:
```
${{ steps.lint_pr_title.outputs.error_message }}
```
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
15 changes: 12 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,18 @@ bin/
dist/
build/

/frontend/dist/*
!/frontend/dist/.gitkeep

# Hostinger-specific files
.cagefs/
.filebrowser/

# Vue distributable files
/frontend/dist/*
!/frontend/dist/.gitkeep

# Playwright files
/frontend/test-results/
/frontend/playwright-report/
/frontend/playwright/.cache/

default.nix
Dockerfile.dev
54 changes: 28 additions & 26 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ linters-settings:
dupl:
threshold: 100
exhaustive:
default-signifies-exhaustive: false
default-signifies-exhaustive: true
funlen:
lines: 100
statements: 50
gci:
local-prefixes: github.com/filebrowser/filebrowser
goconst:
min-len: 2
min-occurrences: 2
Expand All @@ -29,41 +27,51 @@ linters-settings:
goimports:
local-prefixes: github.com/filebrowser/filebrowser
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks: argument,case,condition,return
# don't include the "operation" and "assign"
checks:
- argument
- case
- condition
- return
ignored-numbers:
- '0'
- '1'
- '2'
- '3'
ignored-functions:
- strings.SplitN
govet:
check-shadowing: true
enable:
- nilness
- shadow
lll:
line-length: 140
maligned:
suggest-new: true
misspell:
locale: US
nolintlint:
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
require-explanation: false # require an explanation for nolint directives
require-specific: true # require nolint directives to be specific about which linter is being skipped

linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- bodyclose
- deadcode
- dogsled
- dupl
- errcheck
- errorlint
- exportloopref
- exhaustive
- funlen
- gocheckcompilerdirectives
- gochecknoinits
- goconst
- gocritic
- gocyclo
- godox
- goimports
- gomnd
- goprintffuncname
Expand All @@ -75,18 +83,21 @@ linters:
- misspell
- nakedret
- nolintlint
- prealloc
- revive
- rowserrcheck
- staticcheck
- structcheck
- stylecheck
- testifylint
- typecheck
- unconvert
- unparam
- unused
- whitespace
- prealloc

issues:
exclude-dirs:
- frontend/
exclude-rules:
- path: cmd/.*.go
linters:
Expand All @@ -107,13 +118,4 @@ issues:
- gomnd

run:
go: '1.18'
skip-dirs:
- frontend/
skip-files:
- http/rice-box.go

# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.27.x # use the fixed version to not introduce new linters unexpectedly
timeout: 5m
4 changes: 3 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: 2

project_name: filebrowser

env:
Expand Down Expand Up @@ -189,7 +191,7 @@ brews:
repository:
owner: filebrowser
name: homebrew-tap
folder: Formula
directory: Formula
homepage: https://filebrowser.org
commit_author:
name: FileBrowser Robot
Expand Down
10 changes: 0 additions & 10 deletions .tx/config

This file was deleted.

Loading

0 comments on commit a81c251

Please sign in to comment.