This repository was archived by the owner on Oct 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +16
-10
lines changed Expand file tree Collapse file tree 6 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ export default function codeOfConduct(communityMetrics) {
5
5
title : "Code of Conduct" ,
6
6
} ;
7
7
8
- if ( communityMetrics . files . code_of_conduct ) {
8
+ if ( communityMetrics . files ? .code_of_conduct ) {
9
9
response . status = "success" ;
10
10
response . description = `You have a CoC ${ communityMetrics . files . code_of_conduct . name } .` ;
11
11
response . extra = "No action required." ;
12
12
}
13
13
14
- if ( ! communityMetrics . files . code_of_conduct ) {
14
+ if ( ! communityMetrics . files || ! communityMetrics . files . code_of_conduct ) {
15
15
response . status = "error" ;
16
16
response . description = "You do not have a CoC in your repo." ;
17
17
response . extra =
Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ export default function contributing(communityMetrics) {
5
5
title : "Contributing" ,
6
6
} ;
7
7
8
- if ( communityMetrics . files . contributing ) {
8
+ if ( communityMetrics . files ? .contributing ) {
9
9
response . status = "success" ;
10
10
response . description = "You have a contributing guide." ;
11
11
response . extra = "No action required." ;
12
12
}
13
13
14
- if ( ! communityMetrics . files . contributing ) {
14
+ if ( ! communityMetrics . files || ! communityMetrics . files . contributing ) {
15
15
response . status = "error" ;
16
16
response . description = "You do not have a contributing guide in your repo." ;
17
17
response . extra =
Original file line number Diff line number Diff line change @@ -66,6 +66,9 @@ export function worstCheck(
66
66
warning = "warning" ,
67
67
success = "success" ,
68
68
) {
69
+ if ( ! check ) {
70
+ return "unknow" ;
71
+ }
69
72
return check . red > 0 ? error : check . amber > 0 ? warning : success ;
70
73
}
71
74
Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ export default function license(communityMetrics) {
5
5
title : "License" ,
6
6
} ;
7
7
8
- if ( communityMetrics . files . license ) {
8
+ if ( communityMetrics . files ? .license ) {
9
9
response . status = "success" ;
10
10
response . description = `You have a license ${ communityMetrics . files . license . spdx_id } .` ;
11
11
response . extra = "No action required." ;
12
12
}
13
13
14
- if ( ! communityMetrics . files . license ) {
14
+ if ( ! communityMetrics . files || ! communityMetrics . files . license ) {
15
15
response . status = "error" ;
16
16
response . description = "You do not have a license in your repo." ;
17
17
response . extra = "This does not mean it is moe Open Source but less." ;
Original file line number Diff line number Diff line change @@ -5,13 +5,16 @@ export default function pullRequestTemplate(communityMetrics) {
5
5
title : "Pull Request template" ,
6
6
} ;
7
7
8
- if ( communityMetrics . files . pull_request_template ) {
8
+ if ( communityMetrics . files ? .pull_request_template ) {
9
9
response . status = "success" ;
10
10
response . description = "You have a Pull Request template." ;
11
11
response . extra = "No action required." ;
12
12
}
13
13
14
- if ( ! communityMetrics . files . pull_request_template ) {
14
+ if (
15
+ ! communityMetrics . files ||
16
+ ! communityMetrics . files . pull_request_template
17
+ ) {
15
18
response . status = "error" ;
16
19
response . description =
17
20
"You do not have a pull request template in your repo." ;
Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ export default function readme(communityMetrics) {
5
5
title : "Readme" ,
6
6
} ;
7
7
8
- if ( communityMetrics . files . readme ) {
8
+ if ( communityMetrics . files ? .readme ) {
9
9
response . status = "success" ;
10
10
response . description = "You have a README file." ;
11
11
response . extra = "No action required." ;
12
12
}
13
13
14
- if ( ! communityMetrics . files . readme ) {
14
+ if ( ! communityMetrics . files || ! communityMetrics . files . readme ) {
15
15
response . status = "error" ;
16
16
response . description = "You do not have a readme.md file in your repo." ;
17
17
response . extra = "This is the most important file in your project." ;
You can’t perform that action at this time.
0 commit comments