@@ -79,29 +79,51 @@ async function createFromTemplate(options, template, directory) {
79
79
}
80
80
81
81
function logInit ( options , directory ) {
82
+ const message = options . template
83
+ ? templateInitMessage ( options , directory )
84
+ : regularInitMessage ( options , directory ) ;
85
+
82
86
console . log (
83
87
`All done! I have created a review project at ${ chalk . green (
84
88
( Anonymize . path ( options , directory ) + '/' ) . replace ( / \/ \/ / g, '/' )
85
- ) } for you.`
86
- ) ;
89
+ ) } for you.
87
90
88
- if ( ! options . template ) {
89
- console . log ( `
90
- You can now define your review configuration by editing ${ chalk . green (
91
- Anonymize . path ( options , path . join ( directory , 'src/ReviewConfig.elm' ) )
92
- ) } .
91
+ ${ message }
93
92
94
93
I recommend you take a look at the following documents:
95
94
- How to configure ${ chalk . cyan ( 'elm-review' ) } : ${ chalk . underline (
96
95
'https://github.com/jfmengels/elm-review/#Configuration'
97
96
) }
98
97
- When to write or enable a rule: ${ chalk . underline (
99
- 'https://github.com/jfmengels/elm-review/#when-to-write-or-enable-a-rule'
100
- ) }
101
- ` ) ;
102
- }
98
+ 'https://github.com/jfmengels/elm-review/#when-to-write-or-enable-a-rule'
99
+ ) }
100
+ ${ options . template ? templateRecommendation : '' } `) ;
101
+ }
102
+
103
+ function regularInitMessage ( options , directory ) {
104
+ return `You can now define your review configuration by editing ${ chalk . green (
105
+ Anonymize . path ( options , path . join ( directory , 'src/ReviewConfig.elm' ) )
106
+ ) } .`
103
107
}
104
108
109
+ const orange = chalk . keyword ( 'orange' ) ;
110
+
111
+ function templateInitMessage ( options , directory ) {
112
+ return `You chose to use someone's review configuration which can be great to get started
113
+ but don't forget to review the configuration to make sure it fits your needs,
114
+ both by removing rules you disagree with and by finding new rules to aid you.
115
+ You can do so by editing ${ chalk . green (
116
+ Anonymize . path ( options , path . join ( directory , 'src/ReviewConfig.elm' ) )
117
+ ) } .`
118
+ }
119
+
120
+ const templateRecommendation = `
121
+ By starting out with this configuration, you may end up with too many errors to handle at once.
122
+ I recommend you use a mix of the following approaches:
123
+ - Enable rules one by one by commenting them out at first
124
+ - Use ${ orange ( 'elm-review suppress' ) } to suppress existing errors but prevent future ones (see ${ orange ( 'elm-review suppress --help' ) } ).
125
+ `
126
+
105
127
async function create ( options , directory , template ) {
106
128
const configDirectory = path . join ( directory , 'src' ) ;
107
129
0 commit comments