Repository navigation
Custom matches:
AbstractMatch.prunable_child_value()now defaults toNone. If your
Matchrelied on the old default (False, i.e. constant-Falsechildren are removed from
rules), override it and returnFalseexplicitly.AnyMatch,AllMatch,SomeMatchand
RatioMatchare unaffected.
- refactor!:
AbstractMatch.prunable_child_value()defaults toNone(nothing is pruned), which is
always correct. The old default ofFalsesilently changed the result of a custom AND-like
match. - fix: re-downloading dependencies on Windows while Magika is loaded no longer breaks the install.
The old dependencies, which can't be deleted then, are now moved aside and removed on the next
start, instead of being half-deleted with the new ones installed into a subdirectory. - fix!: an invalid
is_size/is_line_countcomparator, or a non-integercontains/contains_regex
threshold, makes the rule invalid. Previously such a constraint never matched, so with"not"
it matched every file. - fix: for a file between half and all of
trim_file_sizelong, the middle of its content was
tested twice, e.g.containswith athresholdof2matched a single occurrence. - fix!: a rule containing an unknown or invalid match/constraint is now dropped as a whole.
Previously only the bad entry was removed, which could change what the rule meant: anall
whose only constraint was misspelled became an emptyall, which matches every file.
Debug Information reports such a rule as
never matches: it contains an unknown or invalid match/constraint. - fix: shebang, modeline, heuristics, new-file syntax and Magika detection kept working only
while at least one syntax rule was active. A window with no active rule now still runs them. - fix: a custom implementation that fails to import with anything other than
ImportError
(e.g. aSyntaxError) no longer stops the whole plugin from starting. It's logged with its
traceback and skipped. - fix: custom implementations no longer vanish after the plugin is reloaded (e.g. upgraded by
Package Control). The cached custom modules used to be reused, and their classes still
inherited from the base classes of the previous load. A reload now also picks up edited
custom files. - fix!: invalid
some/ratioarguments make the rule invalid.someneeds exactly one
non-negative integer;rationeeds a non-negative numerator and a positive denominator.
Previously, e.g.somewithout arguments orratiowith a zero denominator silently matched
every file. - fix:
ratiocomputes its goal exactly. With floats,[7, 25]over 25 rules required 8 of them
to pass instead of 7. - fix: an
allwith a sub-rule that never matches (e.g.is_platformfor another OS) is now
reported as dropped, with the sub-rule's reason. Likewise, ananywith a sub-rule that always
matches. Such rules used to stay silently in the compiled rules. - fix:
is_javascript_projectno longer depends on the order files are opened in. A file in a
TypeScript package nested inside a JavaScript project was treated as JavaScript once any file
of the outer project had been checked. - feat!:
name_containsandpath_containstake acase_insensitivekwarg, defaulting like
is_name/is_extension: case-insensitive on Windows and macOS (case-insensitive
filesystems), case-sensitive on Linux. They used to be case-sensitive everywhere, so on Windows
and macOS existing rules may now match more files -- e.g. the bundled "Django templates" rule's
/templates/now also matches aTemplatesfolder. Set"case_insensitive": falseto keep
the old behavior. - fix: "Download Dependencies" always verifies the SHA-256 checksum. A missing (404) or empty
checksum file used to skip verification and install the archive unchecked; now it aborts. The
checksum is also fetched first, so such a failure no longer costs the large archive download. - fix: a malformed syntax rule (an unknown key like
"constrait", or a wrong type like
"args": "py") is now dropped alone. One such rule used to make the plugin ignore every rule,
the bundled ones included. Debug Information lists it with where it is and what's wrong, e.g.
invalid setting at user_syntax_rules[3]: rules[0].constrait: Extra inputs are not permitted.
A rules setting that isn't a list (e.g. a single rule without the surrounding[...]) is
reported the same way instead of being ignored silently. - fix!:
relative_existswith amatchother than"any"/"all"makes the rule invalid.
Previously a typo such as"al"silently meant"any". - fix: a constraint that raises while testing a view is logged in that view's window (not the
active one), with the constraint's class name. - fix: the parent-marker constraints (
is_in_git_repo,is_python_project, ...) forget the
directories they found when a window's rules are recompiled. A deleted marker no longer
counts until the plugin is reloaded. - fix:
debounceandrun_on_startup_viewsfollow the project settings of the view's own
window, instead of those of whichever window is active. - fix: the settings schema described every constraint after
is_extensionwith the wrong
tooltip, because the sixis_*_projectconstraints had no description.