Skip to content

Commit be8a6e2

Browse files
Add files via upload
ast-grep pre and post transformation files. QCT orchestrator file
1 parent 703870a commit be8a6e2

3 files changed

+51
-0
lines changed

custom-transformation-post-qct.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
id: no-unused-vars
2+
language: java
3+
rule:
4+
kind: local_variable_declaration
5+
all:
6+
- has:
7+
has:
8+
kind: identifier
9+
pattern: $IDENT
10+
- not:
11+
precedes:
12+
stopBy: end
13+
has:
14+
stopBy: end
15+
any:
16+
- { kind: identifier, pattern: $IDENT }
17+
- { has: {kind: identifier, pattern: $IDENT, stopBy: end}}
18+
fix: ''

custom-transformation-pre-qct.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
id: sysout-to-logger
2+
language: java
3+
rule:
4+
pattern: System.out.println($MATCH)
5+
fix: logger.info($MATCH)
6+
#rule:
7+
# kind: local_variable_declaration
8+
# all:
9+
# - has:
10+
# has:
11+
# kind: identifier
12+
# pattern: $IDENT
13+
# - not:
14+
# precedes:
15+
# stopBy: end
16+
# has:
17+
# stopBy: end
18+
# any:
19+
# - { kind: identifier, pattern: $IDENT }
20+
# - { has: {kind: identifier, pattern: $IDENT, stopBy: end}}
21+
#fix: ''vi

orchestrator_qct_cli.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: orchestrator_qct_cli
2+
description: My collection of custom transformations to run before and after a transformation.
3+
4+
pre_qct_actions:
5+
ast-grep:
6+
rules:
7+
- custom-transformation-pre-qct.yaml
8+
9+
post_qct_actions:
10+
ast-grep:
11+
rules:
12+
- custom-transformation-post-qct.yaml

0 commit comments

Comments
 (0)