File tree 5 files changed +58
-19
lines changed
5 files changed +58
-19
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ function getPatterns() {
25
25
return patterns ;
26
26
}
27
27
28
- async function preCommit ( ) {
28
+ async function preCommit ( log ) {
29
29
// when merging, we want to stage all the files
30
30
try {
31
31
await run ( 'git merge HEAD' ) ;
@@ -45,17 +45,22 @@ async function preCommit() {
45
45
return ;
46
46
}
47
47
48
- toUnstage . forEach ( ( file ) =>
49
- console . log (
50
- chalk . black . bgYellow ( '[INFO]' ) ,
51
- `Generated file found, unstaging: ${ file } `
52
- )
53
- ) ;
48
+ if ( log ) {
49
+ toUnstage . forEach ( ( file ) =>
50
+ console . log (
51
+ chalk . black . bgYellow ( '[INFO]' ) ,
52
+ `Generated file found, unstaging: ${ file } `
53
+ )
54
+ ) ;
55
+ }
54
56
await run ( `git restore --staged ${ toUnstage . join ( ' ' ) } ` ) ;
55
57
}
56
58
57
59
if ( require . main === module && process . env . CI !== 'true' ) {
58
- preCommit ( ) ;
60
+ preCommit ( true ) . then ( ( ) => {
61
+ // Run it twice because of renamed files, the first one delete the renamed one and leaves the deleted file, which is removed by this second pass
62
+ preCommit ( false ) ;
63
+ } ) ;
59
64
}
60
65
61
66
module . exports = { getPatterns } ;
Original file line number Diff line number Diff line change @@ -23,9 +23,9 @@ recommendHit:
23
23
objectID :
24
24
$ref : ' ../../../common/parameters.yml#/objectID'
25
25
_highlightResult :
26
- $ref : ' ../../../search/common/schemas/Hit.yml#/highlightResult '
26
+ $ref : ' ../../../search/common/schemas/Hit.yml#/highlightResultMap '
27
27
_snippetResult :
28
- $ref : ' ../../../search/common/schemas/Hit.yml#/snippetResult '
28
+ $ref : ' ../../../search/common/schemas/Hit.yml#/snippetResultMap '
29
29
_rankingInfo :
30
30
$ref : ' ../../../search/common/schemas/Hit.yml#/rankingInfo'
31
31
_distinctSeqID :
Original file line number Diff line number Diff line change 8
8
objectID :
9
9
$ref : ' ../../../common/parameters.yml#/objectID'
10
10
_highlightResult :
11
- $ref : ' #/highlightResult '
11
+ $ref : ' #/highlightResultMap '
12
12
_snippetResult :
13
- $ref : ' #/snippetResult '
13
+ $ref : ' #/snippetResultMap '
14
14
_rankingInfo :
15
15
$ref : ' #/rankingInfo'
16
16
_distinctSeqID :
20
20
_distinctSeqID :
21
21
type : integer
22
22
23
- highlightResult :
23
+ highlightResultOption :
24
24
type : object
25
- description : Highlighted attributes .
25
+ description : Show highlighted section and words matched on a query .
26
26
additionalProperties : false
27
27
properties :
28
28
value :
@@ -37,15 +37,49 @@ highlightResult:
37
37
fullyHighlighted :
38
38
type : boolean
39
39
description : Whether the entire attribute value is highlighted.
40
+ required :
41
+ - value
42
+ - matchLevel
43
+ - matchedWords
40
44
41
- snippetResult :
45
+ highlightResult :
46
+ oneOf :
47
+ - $ref : ' #/highlightResultOption'
48
+ - type : array
49
+ items :
50
+ $ref : ' #/highlightResultOption'
51
+
52
+ highlightResultMap :
53
+ type : object
54
+ description : Show highlighted section and words matched on a query.
55
+ additionalProperties :
56
+ $ref : ' #/highlightResult'
57
+
58
+ snippetResultOption :
42
59
type : object
60
+ description : Snippeted attributes show parts of the matched attributes. Only returned when attributesToSnippet is non-empty.
43
61
additionalProperties : false
44
62
properties :
45
63
value :
46
64
$ref : ' #/highlightedValue'
47
65
matchLevel :
48
66
$ref : ' #/matchLevel'
67
+ required :
68
+ - value
69
+ - matchLevel
70
+
71
+ snippetResult :
72
+ oneOf :
73
+ - $ref : ' #/snippetResultOption'
74
+ - type : array
75
+ items :
76
+ $ref : ' #/snippetResultOption'
77
+
78
+ snippetResultMap :
79
+ type : object
80
+ description : Snippeted attributes show parts of the matched attributes. Only returned when attributesToSnippet is non-empty.
81
+ additionalProperties :
82
+ $ref : ' #/snippetResult'
49
83
50
84
rankingInfo :
51
85
type : object
Original file line number Diff line number Diff line change 67
67
type : object
68
68
properties :
69
69
userID :
70
- $ref : ' ../../common/schemas/Hit.yml#/highlightResult '
70
+ $ref : ' ../../common/schemas/Hit.yml#/highlightResultMap '
71
71
clusterName :
72
- $ref : ' ../../common/schemas/Hit.yml#/highlightResult '
72
+ $ref : ' ../../common/schemas/Hit.yml#/highlightResultMap '
73
73
required :
74
74
- userID
75
75
- clusterName
Original file line number Diff line number Diff line change @@ -45,11 +45,11 @@ synonymHit:
45
45
additionalProperties : false
46
46
properties :
47
47
type :
48
- $ref : ' ../../../common/schemas/Hit.yml#/highlightResult '
48
+ $ref : ' ../../../common/schemas/Hit.yml#/highlightResultMap '
49
49
synonyms :
50
50
type : array
51
51
items :
52
- $ref : ' ../../../common/schemas/Hit.yml#/highlightResult '
52
+ $ref : ' ../../../common/schemas/Hit.yml#/highlightResultMap '
53
53
required :
54
54
- objectID
55
55
- type
You can’t perform that action at this time.
0 commit comments