This is an automated email from the ASF dual-hosted git repository.

gcruz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/master by this push:
     new f446823b9 [#8610] added licensing and environment variable for 
pre-commit
f446823b9 is described below

commit f446823b9c29de92ef5060312f6d84e97f23bfac
Author: Guillermo Cruz <[email protected]>
AuthorDate: Thu Aug 17 17:33:59 2023 +0000

    [#8610] added licensing and environment variable for pre-commit
---
 .pre-commit-config.yaml              | 18 ++++++++++++++++--
 AlluraTest/alluratest/test_syntax.py |  2 +-
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 9a5b3cc17..fe4356950 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,5 +1,19 @@
-# See https://pre-commit.com for more information
-# See https://pre-commit.com/hooks.html for more hooks
+#       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.
 
 default_stages: [commit]
 repos:
diff --git a/AlluraTest/alluratest/test_syntax.py 
b/AlluraTest/alluratest/test_syntax.py
index a05ba1281..8124d7684 100644
--- a/AlluraTest/alluratest/test_syntax.py
+++ b/AlluraTest/alluratest/test_syntax.py
@@ -38,7 +38,7 @@ def run(cmd, dir=dir):
 
 def test_run_precommit():
     cmd = "pre-commit run --all-files"
-    code, outputs = run(cmd, dir='/src/allura')
+    code, outputs = run(cmd, dir=os.environ.get('ALLURA_GIT_DIR'))
     if code != 0:
         raise Exception(f'pre-commit failed to run: {outputs[0].decode()} 
{outputs[1].decode()}')
 

Reply via email to