Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint improvement #6

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0ad28d3
add generation of docker and config files
FrancoLiberali Jul 28, 2023
217159d
update docs
FrancoLiberali Jul 28, 2023
007cfbb
add changelog, gitignore and makefile
FrancoLiberali Jul 28, 2023
4fde7c6
add lint config
FrancoLiberali Jul 28, 2023
e176406
add github ci, github templates and sonarcloud properties
FrancoLiberali Jul 28, 2023
1f1fe00
move command gen to gen docker
FrancoLiberali Aug 1, 2023
5b0e974
add todo for the user to make secure the db
FrancoLiberali Aug 1, 2023
69598fa
add conditions generation
FrancoLiberali Aug 1, 2023
6538a9b
add conditions tests
FrancoLiberali Aug 1, 2023
379f045
update docs
FrancoLiberali Aug 1, 2023
92c4c5e
update changelog
FrancoLiberali Aug 1, 2023
40fadc9
refactor: get type to avoid type.type
FrancoLiberali Aug 2, 2023
921c8c5
add support for operators in conditions
FrancoLiberali Aug 2, 2023
f13b79b
support sql nullable types
FrancoLiberali Aug 2, 2023
81e9e4d
update changelog
FrancoLiberali Aug 2, 2023
1c58562
replace inverse join generation by inverse reference in models
FrancoLiberali Aug 3, 2023
b1282ff
refactor: add code generator
FrancoLiberali Aug 3, 2023
7453ec8
add relation field to join conditions
FrancoLiberali Aug 3, 2023
645c08b
fix embedded conditions name to avoid repetition
FrancoLiberali Aug 3, 2023
c990684
conditions now use field identifier
FrancoLiberali Aug 3, 2023
de7a191
generation of preload attributes
FrancoLiberali Aug 3, 2023
a879449
add preload relations
FrancoLiberali Aug 3, 2023
62ec80b
add preload to join conditions to support nested preloads
FrancoLiberali Aug 3, 2023
0af08d3
generate relation getters
FrancoLiberali Aug 3, 2023
4b99615
generate conditions for collections
FrancoLiberali Aug 3, 2023
655c94f
update badaas version
FrancoLiberali Aug 3, 2023
65bb310
clean tests result before tests execution
FrancoLiberali Aug 3, 2023
57620a6
update changelog
FrancoLiberali Aug 3, 2023
6d99e6a
make field identifiers exported and add the reflect type
FrancoLiberali Aug 4, 2023
89dda48
update badaas version
FrancoLiberali Aug 7, 2023
58703d4
update changelog
FrancoLiberali Aug 7, 2023
ec109ae
add new linting config
FrancoLiberali Aug 7, 2023
8259abe
fix new lint errors
FrancoLiberali Aug 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: Bug
---

## Describe the bug

A clear and concise description of what the bug is.

## To Reproduce

Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

## Expected behavior

A clear and concise description of what you expected to happen.

## Screenshots

If applicable, add screenshots to help explain your problem.

## Application

Please complete the following information:

- badaas version [X.X.X] or commit hash

## Additional context

Add any other context about the problem here.
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/user_story.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: User Story, To be verify
---

## Description

**As a** `[roles impacted]`,

**I want** `[clear context and goals]`

**so that** `[result of this story]`.

## Acceptance Criteria

**Scenario** | `[the name for the behavior that will be described]`
------------ | -------------------------------------------------
**Given** | `[the beginning state of the scenario]`
**When** | `[specific action that the user makes]`
**Then** | `[the outcome of the action in “When”]`
**And** | `[used to continue any of three previous statements]`

### Constraints

`[Put all others constraints here, like list of acceptances values or other]`

## Resources

`[Put all your resources here, like mockups, diagrams or other here]`

## Notes

`[Some complementary notes if necessary]`

## Links

`[Only use by the team, to link this feature with epic, technical tasks or bugs]`
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:information_source: Don't forget to modify the changelog.md before merging this branch.
77 changes: 77 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
branch-naming-rules:
name: Check branch name
runs-on: ubuntu-latest
steps:
- uses: deepakputhraya/action-branch-name@master
with:
regex: '^(feature|bugfix|improvement|library|prerelease|release|hotfix|poc)\/[a-z0-9_.-]+$'
allowed_prefixes: 'feature,bugfix,improvement,library,prerelease,release,hotfix,poc'
ignore: main,dev
min_length: 5
max_length: 50

check-style:
name: Code style
needs: [branch-naming-rules]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '^1.18'
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
skip-cache: true
skip-pkg-cache: true
skip-build-cache: true

unit-tests:
name: Unit tests
needs: [branch-naming-rules]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '^1.18'
cache: true
- name: Run unit tests
run: go test ./... -coverprofile=coverage_unit.out -v
- uses: actions/upload-artifact@v3
with:
name: coverage_unit
path: coverage_unit.out

sonarcloud:
name: SonarCloud
needs: [unit-tests, check-style]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download unit tests line coverage report
uses: actions/download-artifact@v3
with:
name: coverage_unit
path: coverage_unit.out
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
vendor/

# Go workspace file
go.work

# vscode conf
.vscode

# binary output
badaas-cli

# test results
cmd/gen/conditions/*_conditions.go
cmd/gen/conditions/tests/**/badaas-orm.go
Loading