Commit Graph

62 Commits

Author SHA1 Message Date
Ben Ogle
54af7eced1 Handle empty config files + reset settings before applying user config
Closes #3664
2014-09-30 12:39:07 -07:00
Ben Ogle
b54deccfae String type must be strict.
It makes sense to coerce from more general -> more specific data types.
eg. string -> int, etc. But coercing the other way is problematic
in the case of chaining because the more general type will swallow the
specific type. eg. Setting `false` on type: [‘string’, ‘boolean’] will 
coerce the boolean to a string, and will never allow the value to be
a boolean.
2014-09-29 16:09:49 -07:00
Ben Ogle
a7185a894f Fix specs 2014-09-29 16:09:49 -07:00
Ben Ogle
16c7fd3d70 Add spec for update event on load 2014-09-29 16:09:49 -07:00
Ben Ogle
08b138997d Change the onDidChange / observe arguments
Support passing no keypath
2014-09-29 16:09:48 -07:00
Ben Ogle
ef19e925e9 Strings accept numbers too 2014-09-29 16:09:48 -07:00
Ben Ogle
2c1fa19e27 Update spec strings 2014-09-29 16:09:48 -07:00
Ben Ogle
22fb5adda9 Remove deprecated calls for config.observe .. callNow: false in core 2014-09-29 16:09:47 -07:00
Ben Ogle
800dee09ba Make boolean schema validator a little tighter 2014-09-29 16:09:47 -07:00
Ben Ogle
6b4ce902ba Undefined in Config::set always unsets the value 2014-09-29 16:09:46 -07:00
Ben Ogle
03a9a67ba8 Move spec 2014-09-29 16:08:04 -07:00
Ben Ogle
ae76bd6c96 Do not allow infinity in number types 2014-09-29 16:08:04 -07:00
Ben Ogle
662fc443dc Fix specs 2014-09-29 16:08:04 -07:00
Ben Ogle
0fc773c1fc Warn when loading bogus values from the user's config 2014-09-29 16:08:03 -07:00
Ben Ogle
af1bdaf901 Dont fail when there are thigns to set with array and object types 2014-09-29 16:08:03 -07:00
Ben Ogle
0d2fdec326 Fix specs in config 2014-09-29 16:08:03 -07:00
Ben Ogle
9fff544955 Fix specs 2014-09-29 16:05:24 -07:00
Ben Ogle
9fbbd1e59b Back to getSchema 2014-09-29 16:05:24 -07:00
Ben Ogle
2c1190b552 Validate enum keywords 2014-09-29 16:05:24 -07:00
Ben Ogle
5e9a269278 getSchema -> schemaForKeyPath 2014-09-29 16:05:24 -07:00
Ben Ogle
f7f28e7995 Handle minimum and maximum keywords on number types 2014-09-29 16:05:24 -07:00
Ben Ogle
ac67430926 Handle bad values in number type 2014-09-29 16:05:23 -07:00
Ben Ogle
409b5536e1 Support arrays 2014-09-29 16:05:23 -07:00
Ben Ogle
2526ba0efb Add an object filter 2014-09-29 16:05:23 -07:00
Ben Ogle
1a8c5ba551 Handle validation of schema types 2014-09-29 16:05:23 -07:00
Ben Ogle
f909d32826 Support more types 2014-09-29 16:05:23 -07:00
Ben Ogle
d0bb49dea0 Add type filter system to config 2014-09-29 16:05:23 -07:00
Ben Ogle
02e87555f4 Handle schema loading 2014-09-29 16:05:23 -07:00
Ben Ogle
a79c015774 Update ::observe and add ::onDidChange 2014-09-29 16:05:23 -07:00
Nathan Sobo
d37cfb9042 Assign default invisible character glyphs via config defaults
This commit also extends config.get to merge default values into the
returned object if both the assigned and default values are objects.
This allows 'atom.invisibles' to be treated as an object that always has
the default values filled in.
2014-08-13 16:32:13 -06:00
Nathan Sobo
7a4a85cb20 Fix failures running config specs locally 2014-05-16 09:00:01 -06:00
Kevin Sawicki
408665d7d2 Add Config::isDefault(keyPath) 2014-04-17 13:24:34 -07:00
Kevin Sawicki
541ffa5057 💄 Combine specs 2014-04-17 13:24:34 -07:00
Kevin Sawicki
0ea683e0b5 💄 Move expect up one line 2014-04-17 13:24:34 -07:00
Kevin Sawicki
f12004d27b Add object to default value spec 2014-04-17 13:24:34 -07:00
Kevin Sawicki
35d268fcf8 Use _.isEqual when comparing value to default 2014-04-17 13:24:34 -07:00
Kevin Sawicki
20c3ca21e3 Add Config::getDefault(keyPath) 2014-04-17 13:24:34 -07:00
Kevin Sawicki
f153cbb41f Don't call Config::save when setting defaults
Instead just emit an updated event, saving is not needed
because only the defaults are changing.
2014-04-03 11:00:45 -07:00
Kevin Sawicki
0307c0e6c9 Rename ~/.atom/styles.css to ~/.atom/styles.less 2014-02-24 16:14:05 -08:00
Kevin Sawicki
55f4a7b63e Remove unneeded exists checks 2014-02-23 17:26:49 -08:00
Kevin Sawicki
a651254e38 Require fs-plus directly in specs 2014-02-23 17:19:00 -08:00
Kevin Sawicki
dda412d5ec Add window:reset-font-size command 2014-02-11 15:40:12 -08:00
Kevin Sawicki
422c0e36cb Assert init.coffee and styles.css are copied 2014-02-07 09:54:58 -08:00
Kevin Sawicki
a67d6362c2 Assert snippet.cson is copied over 2014-01-27 12:50:57 -08:00
Nathan Sobo
88eb803d91 Mock season.writeFileSyne instead of fs.writeFileSync in config specs
The spec suite has been overwriting my config directory in weird cases.
While investigating it I noticed that we mock writeFileSync directly in
these specs, but we actually use season to write the config cson. This
makes this spec a bit simpler because it doesn't have to parse the CSON
in the spec. Lower level assertions belong on the season package itself.
2013-12-06 22:10:26 -08:00
Kevin Sawicki
d2369e94c8 Add atom prefix to config reference 2013-11-20 12:48:05 -08:00
Kevin Sawicki
f55a200591 Return emissary subscription directly 2013-11-18 18:41:43 -08:00
Kevin Sawicki
055109a708 Remove incorrect atom. prefix from filename 2013-11-11 09:57:10 -08:00
Kevin Sawicki
a377a49004 Use atom.config instead of window.config 2013-11-11 09:16:44 -08:00
Kevin Sawicki
5756ec45ba Add Config::toggle 2013-11-11 09:06:33 -08:00