diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 370660417..6d633c496 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,8 +23,6 @@ jobs: go-version: 1.19 - name: Lint buf run: make buf-lint - - name: check prettier format - run: npm ci && npm run format:check - run: go list -json > go.list - name: Run nancy uses: sonatype-nexus-community/nancy-github-action@v1.0.2 diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 000000000..a7a720ebc --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,17 @@ +name: Format + +on: + pull_request: + push: + +jobs: + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: 1.19 + - run: make format + - name: Indicate formatting issues + run: git diff HEAD --exit-code --color diff --git a/Makefile b/Makefile index b5fbfe08b..0acdefe4a 100644 --- a/Makefile +++ b/Makefile @@ -39,8 +39,9 @@ $(foreach dep, $(BREW_DEPENDENCIES), $(eval $(call make-brew-dependency,$(dep))) tools/protobuf: tools/brew Makefile HOMEBREW_NO_AUTO_UPDATE=1 brew install protobuf@3.19 -node_modules: package.json package-lock.json Makefile +node_modules: package-lock.json npm ci + touch node_modules .PHONY: tools/brew tools/brew: @@ -54,7 +55,7 @@ tools/brew: .PHONY: format format: tools/goimports node_modules goimports -w -local github.com/ory/keto *.go internal cmd contrib ketoctx ketoapi embedx - npm run format + npm exec -- prettier --write . .PHONY: install install: diff --git a/package-lock.json b/package-lock.json index 14730b942..9ce3ecf99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "doctoc": "^2.0.1", "opencollective": "^1.0.3", "ory-prettier-styles": "^1.2.0", - "prettier": "^2.7.1", + "prettier": "2.7.1", "prettier-plugin-packagejson": "^2.2.18" } }, @@ -891,7 +891,7 @@ "version": "0.1.13", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "dev": true, + "devOptional": true, "dependencies": { "iconv-lite": "^0.6.2" } @@ -900,7 +900,7 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, + "devOptional": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -3769,7 +3769,7 @@ "version": "0.1.13", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "dev": true, + "devOptional": true, "requires": { "iconv-lite": "^0.6.2" }, @@ -3778,7 +3778,7 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, + "devOptional": true, "requires": { "safer-buffer": ">= 2.1.2 < 3.0.0" } diff --git a/package.json b/package.json index 7ef29362e..4b0a7a69c 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,6 @@ }, "scripts": { "doctoc": "doctoc README.md", - "format": "prettier --write .", - "format:check": "prettier --check .", "openapi-generator-cli": "openapi-generator-cli" }, "prettier": "ory-prettier-styles", @@ -22,7 +20,7 @@ "doctoc": "^2.0.1", "opencollective": "^1.0.3", "ory-prettier-styles": "^1.2.0", - "prettier": "^2.7.1", + "prettier": "2.7.1", "prettier-plugin-packagejson": "^2.2.18" }, "collective": { diff --git a/proto/ory/keto/relation_tuples/v1alpha2/check_service.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/check_service.pb.go index 7ef862067..68383b9f1 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/check_service.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/check_service.pb.go @@ -63,10 +63,11 @@ type CheckRequest struct { // of the same content version. // // Example use case: - // - You need to authorize a user to modify/delete some resource - // and it is unacceptable that if the permission to do that had - // just been revoked some seconds ago so that the change had not - // yet been fully replicated to all availability zones. + // - You need to authorize a user to modify/delete some resource + // and it is unacceptable that if the permission to do that had + // just been revoked some seconds ago so that the change had not + // yet been fully replicated to all availability zones. + // // --> Latest bool `protobuf:"varint,5,opt,name=latest,proto3" json:"latest,omitempty"` // This field is not implemented yet and has no effect. diff --git a/proto/ory/keto/relation_tuples/v1alpha2/read_service.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/read_service.pb.go index 91a2281a0..56744190a 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/read_service.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/read_service.pb.go @@ -207,12 +207,11 @@ func (x *ListRelationTuplesResponse) GetNextPageToken() string { // partially filter for specific relation tuples. // // Example use cases (namespace is always required): -// - object only: display a list of all permissions referring to a specific object -// - relation only: get all groups that have members; get all directories that have content -// - object & relation: display all subjects that have a specific permission relation -// - subject & relation: display all groups a subject belongs to; display all objects a subject has access to -// - object & relation & subject: check whether the relation tuple already exists -// +// - object only: display a list of all permissions referring to a specific object +// - relation only: get all groups that have members; get all directories that have content +// - object & relation: display all subjects that have a specific permission relation +// - subject & relation: display all groups a subject belongs to; display all objects a subject has access to +// - object & relation & subject: check whether the relation tuple already exists type ListRelationTuplesRequest_Query struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/proto/ory/keto/relation_tuples/v1alpha2/relation_tuples.pb.go b/proto/ory/keto/relation_tuples/v1alpha2/relation_tuples.pb.go index 068c18471..764f9dcbb 100644 --- a/proto/ory/keto/relation_tuples/v1alpha2/relation_tuples.pb.go +++ b/proto/ory/keto/relation_tuples/v1alpha2/relation_tuples.pb.go @@ -104,11 +104,11 @@ func (x *RelationTuple) GetSubject() *Subject { // partially filter for specific relation tuples. // // Example use cases (namespace is always required): -// - object only: display a list of all permissions referring to a specific object -// - relation only: get all groups that have members; get all directories that have content -// - object & relation: display all subjects that have a specific permission relation -// - subject & relation: display all groups a subject belongs to; display all objects a subject has access to -// - object & relation & subject: check whether the relation tuple already exists +// - object only: display a list of all permissions referring to a specific object +// - relation only: get all groups that have members; get all directories that have content +// - object & relation: display all subjects that have a specific permission relation +// - subject & relation: display all groups a subject belongs to; display all objects a subject has access to +// - object & relation & subject: check whether the relation tuple already exists type RelationQuery struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -197,6 +197,7 @@ type Subject struct { // The reference of this abstract subject. // // Types that are assignable to Ref: + // // *Subject_Id // *Subject_Set Ref isSubject_Ref `protobuf_oneof:"ref"`