File tree Expand file tree Collapse file tree 5 files changed +64
-52
lines changed Expand file tree Collapse file tree 5 files changed +64
-52
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,12 @@ class BlackProcess {
55 }
66
77 process ( ) {
8- let blackPath = nova . workspace . config . get ( "is.flother.Blake.blackExecutablePath" ) ;
9- const maxLineLength = nova . workspace . config . get ( "is.flother.Blake.maxLineLength" ) ;
8+ let blackPath =
9+ nova . workspace . config . get ( "is.flother.Blake.blackExecutablePath" ) ??
10+ nova . config . get ( "is.flother.Blake.blackExecutablePath" ) ;
11+ const maxLineLength =
12+ nova . workspace . config . get ( "is.flother.Blake.maxLineLength" ) ??
13+ nova . config . get ( "is.flother.Blake.maxLineLength" ) ;
1014 let commandArguments = [ "--quiet" , "-" ] ;
1115 if ( maxLineLength ) {
1216 commandArguments = [ "--line-length" , maxLineLength . toString ( ) , ...commandArguments ] ;
Original file line number Diff line number Diff line change @@ -7,8 +7,12 @@ class Flake8Process {
77 }
88
99 async process ( commandArguments ) {
10- let flake8Path = nova . workspace . config . get ( "is.flother.Blake.flake8ExecutablePath" ) ;
11- const maxLineLength = nova . workspace . config . get ( "is.flother.Blake.maxLineLength" ) ;
10+ let flake8Path =
11+ nova . workspace . config . get ( "is.flother.Blake.flake8ExecutablePath" ) ??
12+ nova . config . get ( "is.flother.Blake.flake8ExecutablePath" ) ;
13+ const maxLineLength =
14+ nova . workspace . config . get ( "is.flother.Blake.maxLineLength" ) ??
15+ nova . config . get ( "is.flother.Blake.maxLineLength" ) ;
1216 let args = commandArguments ;
1317 if ( maxLineLength ) {
1418 args = [ "--max-line-length" , maxLineLength . toString ( ) , ...args ] ;
Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ exports.activate = () => {
1717 editor . onDidSave ( ( ) => linter . lintDocument ( document ) ) ;
1818 document . onDidChangeSyntax ( linter . lintDocument ) ;
1919 editor . onWillSave ( ed => {
20- const formatOnSave = nova . workspace . config . get ( "is.flother.Blake.formatOnSave" ) ;
20+ const formatOnSave =
21+ nova . workspace . config . get ( "is.flother.Blake.formatOnSave" ) ||
22+ nova . config . get ( "is.flother.Blake.formatOnSave" ) ;
2123 if ( formatOnSave ) {
2224 return formatter . format ( ed ) ;
2325 }
Original file line number Diff line number Diff line change 1+ [
2+ {
3+ "title" : " General" ,
4+ "type" : " section" ,
5+ "children" : [
6+ {
7+ "key" : " is.flother.Blake.maxLineLength" ,
8+ "title" : " Max line length" ,
9+ "description" : " Maximum number of characters allowed per line" ,
10+ "type" : " number" ,
11+ "placeholder" : 88
12+ }
13+ ]
14+ },
15+ {
16+ "title" : " Flake8" ,
17+ "type" : " section" ,
18+ "children" : [
19+ {
20+ "key" : " is.flother.Blake.flake8ExecutablePath" ,
21+ "title" : " Executable path" ,
22+ "description" : " Path to this workspace's Flake8 executable" ,
23+ "type" : " path" ,
24+ "placeholder" : " /usr/bin/env flake8"
25+ }
26+ ]
27+ },
28+ {
29+ "title" : " Black" ,
30+ "type" : " section" ,
31+ "children" : [
32+ {
33+ "key" : " is.flother.Blake.blackExecutablePath" ,
34+ "title" : " Executable path" ,
35+ "description" : " Path to this workspace's Black executable" ,
36+ "type" : " path" ,
37+ "placeholder" : " /usr/bin/env black"
38+ },
39+ {
40+ "key" : " is.flother.Blake.formatOnSave" ,
41+ "title" : " Format Python source code files on save" ,
42+ "type" : " boolean" ,
43+ "default" : false
44+ }
45+ ]
46+ }
47+ ]
Original file line number Diff line number Diff line change 2626 }
2727 ]
2828 },
29- "configWorkspace" : [
30- {
31- "title" : " General" ,
32- "type" : " section" ,
33- "children" : [
34- {
35- "key" : " is.flother.Blake.maxLineLength" ,
36- "title" : " Max line length" ,
37- "description" : " Maximum number of characters allowed per line" ,
38- "type" : " number" ,
39- "placeholder" : 88
40- }
41- ]
42- },
43- {
44- "title" : " Flake8" ,
45- "type" : " section" ,
46- "children" : [
47- {
48- "key" : " is.flother.Blake.flake8ExecutablePath" ,
49- "title" : " Executable path" ,
50- "description" : " Path to this workspace's Flake8 executable" ,
51- "type" : " path" ,
52- "placeholder" : " /usr/bin/env flake8"
53- }
54- ]
55- },
56- {
57- "title" : " Black" ,
58- "type" : " section" ,
59- "children" : [
60- {
61- "key" : " is.flother.Blake.blackExecutablePath" ,
62- "title" : " Executable path" ,
63- "description" : " Path to this workspace's Black executable" ,
64- "type" : " path" ,
65- "placeholder" : " /usr/bin/env black"
66- },
67- {
68- "key" : " is.flother.Blake.formatOnSave" ,
69- "title" : " Format Python source code files on save" ,
70- "type" : " boolean" ,
71- "default" : false
72- }
73- ]
74- }
75- ]
29+ "config" : " config.json" ,
30+ "configWorkspace" : " config.json"
7631}
You can’t perform that action at this time.
0 commit comments