File tree Expand file tree Collapse file tree 3 files changed +71
-9
lines changed Expand file tree Collapse file tree 3 files changed +71
-9
lines changed Original file line number Diff line number Diff line change 1+ repos :
2+ - repo : local
3+ hooks :
4+ - id : gnatformat
5+ name : Format GNATcheck sources
6+ entry : gnatformat
7+ language : system
8+ files : " ^lkql_checker/src/.*\\ .ad(b|s)$"
9+ - repo : local
10+ hooks :
11+ - id : maven-spotless
12+ name : Format LKQL JIT sources
13+ entry : python
14+ args :
15+ - utils/maven_wrapper.py
16+ - spotless:apply
17+ language : system
18+ pass_filenames : false
19+ require_serial : true
20+ files : " ^lkql_jit/.*\\ .java$"
Original file line number Diff line number Diff line change 122122 <artifactId >spotless-maven-plugin</artifactId >
123123 <version >2.40.0</version >
124124
125- <executions >
126- <execution >
127- <goals >
128- <goal >check</goal >
129- </goals >
130- <phase >validate</phase >
131- </execution >
132- </executions >
133-
134125 <configuration >
135126 <java >
136127 <includes >
Original file line number Diff line number Diff line change 1+ """
2+ This script is a wrapper around the Maven command, it is used by the pre-commit
3+ hooks configuration to simplify the process of running Maven on LKQL JIT
4+ sources.
5+ """
6+
7+ import os
8+ import subprocess
9+ import sys
10+
11+ if __name__ == '__main__' :
12+ # Get the Maven executable
13+ mvn = "mvn.cmd" if os .name == "nt" else "mvn"
14+
15+ # Get the path of the LKQL JIT "pom.xml" file
16+ pom_xml = os .path .abspath (
17+ os .path .join (
18+ os .path .dirname (os .path .realpath (__file__ )),
19+ ".." ,
20+ "lkql_jit" ,
21+ "pom.xml" ,
22+ )
23+ )
24+
25+ # Forward script arguments to Maven and ensure 'MAVEN_ARGS' is taken into
26+ # account.
27+ maven_args = sys .argv [1 :] + (
28+ os .environ ['MAVEN_ARGS' ].split (" " )
29+ if os .environ .get ('MAVEN_ARGS' ) else
30+ []
31+ )
32+
33+ # Set maven to offline mode when running in a Gitlab CI
34+ if "CI_JOB_NAME" in os .environ :
35+ maven_args = [
36+ "-o" ,
37+ * maven_args ,
38+ ]
39+
40+ # Run Maven on LKQL JIT project with additional args of this script
41+ try :
42+ subprocess .check_output ([
43+ mvn ,
44+ "-f" ,
45+ pom_xml ,
46+ "-q" ,
47+ * maven_args
48+ ])
49+ except subprocess .CalledProcessError as e :
50+ print (e .output .decode ())
51+ exit (e .returncode )
You can’t perform that action at this time.
0 commit comments