Skip to content

Commit

Permalink
feat: introduce first two commands validate and verify, introduce con…
Browse files Browse the repository at this point in the history
…fig json schema
  • Loading branch information
omissis committed Aug 16, 2022
1 parent 0115cfc commit 2c237df
Show file tree
Hide file tree
Showing 16 changed files with 1,269 additions and 147 deletions.
97 changes: 13 additions & 84 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,92 +2,21 @@

This project gives developers the ability to describe and check the architecture of a project and check it is respected at any time.

## TODO
## Example usage

- [ ] add docs to tell what options each expression support (even better: enforce that using type system)
- [ ] add support for setting violations severity levels
```sh
# validate the default config file (.goarkitect.yaml)
goarkitect validate

## Desired usecases
# validate the custom .ark.yaml config file
goarkitect validate .ark.yaml

if a folder:
- [ ] exist
- [ ] does not exist
- [ ] contains a specific file
- [ ] contains a specific set of files
- [ ] contains files matching a regex
- [ ] contains files matching a glob pattern
- [ ] contains only a specific file
- [ ] contains only a specific set of files
- [ ] contains only files matching a regex
- [ ] contains only files matching a glob pattern
- [ ] is gitignored
- [ ] is gitcrypted
- [ ] has specific permissions
# validate the custom .ark.yaml config file and all the config files found in the .ark/ folder
goarkitect validate .ark.yaml .ark/

if a file:
- [x] exists
- [x] does not exist
- [x] name matches a regex
- [x] name does not match a regex
- [x] content matches value
- [x] content matches regex
- [ ] content matches template
- [x] content contains a value
- [x] is gitignored
- [x] is gitcrypted
- [x] has specific permissions
# verify that the current folder follows the rules specified in the default config file (.goarkitect.yaml)
goarkitect verify

if a set of files:
- [x] exists
- [x] does not exist
- [x] names match a regex
- [x] names do not match a regex
- [x] paths matching a glob pattern exist
- [x] paths matching a glob pattern do not exist
- [x] is gitignored
- [x] is gitcrypted

if all files that respect some conditions:
- [x] start with a given suffix
- [x] do not start with a given suffix
- [x] end with a given suffix
- [x] do not end with a given suffix
- [x] names match a regex
- [x] names do not match a regex
- [x] paths matching a glob pattern exist
- [x] paths matching a glob pattern do not exist
- [x] are gitignored
- [x] are gitcrypted

if a package:
- [ ] depends on another package
- [ ] contains symbols matching a regex
- [ ] does not contain symbols matching a regex

if a struct:
- [ ] depends on a namespace
- [ ] embeds another struct
- [ ] embeds another interface
- [ ] have a name matching a pattern
- [ ] implements an interface
- [ ] depends on a namespace
- [ ] don't have dependency outside a namespace
- [ ] reside in a package

if a makefile:
- [ ] contains a set of targets
- [ ] does not contain a set of targets

if a json file:
- [ ] matches a json schema

if a yaml file:
- [ ] matches a json schema

if a go module:
- [ ] contains up-to-date dependencies

## Json schema to Golang structs libraries

- https://github.com/atombender/go-jsonschema
- https://github.com/a-h/generate
# verify that the current folder follows the rules specified in the .ark/ folder and outputs the result in json
goarkitect verify -config=.ark -output=json
```
Loading

0 comments on commit 2c237df

Please # to comment.