Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tkc/clean-layer-lint
Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects.
https://github.com/tkc/clean-layer-lint
clean-architecture code-analysis go go-tools golang lint linter
Last synced: 1 day ago
JSON representation
Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects.
- Host: GitHub
- URL: https://github.com/tkc/clean-layer-lint
- Owner: tkc
- License: mit
- Created: 2020-04-13T15:35:50.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-13T18:42:38.000Z (almost 5 years ago)
- Last Synced: 2023-03-03T15:43:40.305Z (almost 2 years ago)
- Topics: clean-architecture, code-analysis, go, go-tools, golang, lint, linter
- Language: Go
- Homepage:
- Size: 8.62 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## clean-layer-lint
![test](https://github.com/tkc/clean-layer-lint/workflows/test/badge.svg)```
_____ _ __ __ _ _
| | |___ ___ ___ | | ___ _ _ ___ ___ | | |_|___| |_
| --| | -_| .'| | | |__| .'| | | -_| _| | |__| | | _|
|_____|_|___|__,|_|_| |_____|__,|_ |___|_| |_____|_|_|_|_|
|___|
```Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects.
Checks illegal imported layer. layer order depend on `clean-layer.json` setteing.![image](https://user-images.githubusercontent.com/181991/79132738-d273ab00-7de5-11ea-818f-1df4f93a782f.png)
## TODO
- [ ] example
- [ ] Specify files to ignore## Install
```bash
$ go get -u github.com/tkc/clean-layer-lint
```## Prepare clean-layer.json
```json
{
"path": "github.com/tkc/clean-layer-lint/src",
"order":[
"domain",
"usecase",
"interfaces",
"infrastructure"
],
"ignore":[]
}
````note:json format`
| key | description |
| :----: | :---- |
| path | go.mod module name + your layer directory path |
| order | your layer order |
| ignore | your ignore layer |## Run
```bash
$ clean-layer-lint ./...
```### GitHub Actions Setting
[lint.yml](https://github.com/tkc/clean-layer-lint/blob/master/.github/workflows/lint.yml)```yml
on: [push, pull_request]
name: lint clean architecture
jobs:
test:
strategy:
matrix:
go-version: [1.13.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
if: success()
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Setup env
run: |
echo "::set-env name=GOPATH::$(go env GOPATH)"
echo "::set-env name=GOBIN::$(go env GOPATH)/bin"
echo "::add-path::$(go env GOPATH)/bin"
- name: install
run: go get -u github.com/tkc/clean-layer-lint
- name: Checkout code
uses: actions/checkout@v1
- name: lint clean architecture
run: clean-layer-lint ./...
```## License
MIT ✨