ruanwenjun commented on code in PR #3939: URL: https://github.com/apache/incubator-seatunnel/pull/3939#discussion_r1098636012
########## tools/spotless_check/pre-commit.sh: ########## @@ -0,0 +1,24 @@ +#!/bin/sh +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# A hook script to automatically fix code style and formatting errors with spotless +if ./mvnw spotless:check; then + exit 0 +fi +./mvnw spotless:apply +exit 1 Review Comment: When I change the code and my format is not correct. Then I execute below command ``` git add ./ git commit ``` This hook will check the format and use `spotless:apply` to format the project. And the commit will failed, I need to execute below command again, the spotless will execute again. ```java git add./ git commit ``` Can we remove `exit 1`? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
