-
Notifications
You must be signed in to change notification settings - Fork 3
Package checks
This document explains the failures and warnings reported by the review tool regarding the package itself and how to resolve these.
Failures and warnings are grouped by their type
and by what they are complaining about.
Their messages are used as headings and
{}
represents a placeholder.
-
Failures
- Key Bindings
- Package Control
-
Other Resource files
- '.pyc' file is redundant because its corresponding .py file exists
- '.cache' file are redundant and created by ST automatically
- Invalid JSON (with comments)
- Invalid Plist
- Invalid XML
- The package contains {} Python file(s), but none of them are in the package root
- The package does not define any file that interfaces with Sublime Text
- '.sublime-package' files have no business being inside a package
- '.sublime-workspace' files contain session data
- Warnings
Key bindings from packages should not override any default bindings, unless they specifically intend to replace the default action.
An example for this would be a package whose main feature is changing how pasting of multiple lines with multiple selections behaves.
A key binding must at least contain the keys
and command
keys.
See here for documentation.
Each key binding must contain a keys
key,
which is a list of key chords.
See here for documentation.
The key used in the key binding is not valid. Valid keys are any visible character and those listed here.
This check is not 100% accurate, so if you believe the key is valid, report this as an issue on the package_reviewer repo.
Valid modifier keys are:
super
, ctrl
,
option
(= alt
), alt
and shift
.
'package-metadata.json' is supposed to be automatically generated by Package Control during installation
This file is absolutely redundant and should never be submitted to a version control. It shouldn't even exist inside a package that was not installed by Package Control at all.
A messages/
folder usually indicates
an intent to use
the messaging feature of Package Control.
For this, however,
a messages.json
file in the package root is required.
You can read more at the docs.
The messages.json
file must be
a valid JSON document.
Unlike configuration files,
this means that neither comments
nor trailing commas are allowed.
Read the exception message included in the report for more details about why the file couldn't be loaded.
All keys of the messages.json
file
must be either "install"
or a semantic version string.
Refer to the docs for details.
Entries in the messages.json
mapping
need to be relative file paths
and point to a file
that exists inside the repository.
.pyc
files are cached binary files
created by Sublime Text
when compiling plugins.
ST2 places these next to the source file,
but as long as the source file itself exists,
it is redundant to add these to version control.
Remove them from the repo
and add *.pyc
to your .gitignore
.
Same situation as for .pyc
.
ST2 creates cache files for property lists,
which are entirely redundant to submit to version control.
Remove them from the repo
and add *.cache
to your .gitignore
.
These three errors are the result of a resource file being unparsable. Check the corresponding exception message for more information on how to resolve the issue.
[...] and no build system is specified.
Python plugins must be placed in the package's root, which equals to the repository root. Check if you accidentally placed your plugins in a subfolder.
Are you sure this is a Package for Sublime Text?
Package Control will download a snapshot of the repo and use that as base for creating a '.sublime-package' archive on the user's machine.
[...] and should never be submitted to version control
As mentioned in the message,
these files should never be shared with anyone or anything
and immediately added to your *.gitignore
.
Take a look for yourself.
Package bindings can override default bindings in certain situations for various reasons. Because we cannot possibly analyze this automatically, this warning exists to suggest a human audit over a package's bindings.
[...] because of how limited the configuration options are. Instead, suggest the user to add specific bindings to their User package.
Unlike keymaps, mousemaps do not accept a context restrictor and are thus always active. In order not to create conflicts with other packages (and the built-in bindings), do not define bindings by default and let the user manage them instead.
[...] and there is no '.tmLanguage' fallback file
In your sublime_text
version selector,
you should write that the package
requires at least build 3092
because it defines a .sublime-syntax
file
without a .tmLanguage
replacement file
for older builds in place.
Because package_reviewer does not look at the repository submission, this might be a false positive.
The .no-sublime-package
file
tells Package Control to extract your package
and store it in the Packages
instead of the Installed Packages folder.
This has the disadvantage
that a user can not easily override
only parts of a package anymore
and should thus only be done
when it is essential for the package to work.
The .no-sublime-package
file is only needed if
(ordered by frequency of occurrence):
- The package executes binaries
included in the package itself
using the
subprocess
module in Python plugins or a build system. - The package runs scripts
included in the package
using an external application,
such as
node
. - The plugin code loads binary Python modules.
- A bug in Sublime Text prevents a certain feature from working if in archived state (none known currently).
It is not needed for bundling Python modules. Relative imports work just fine in Sublime Text 3
For reading files from the package within a Python plugin,
use the sublime.load_resource
API.
For storing data in files,
consider using the User package
or ST's cache folder (sublime.cache_path()
).
This check is not 100% accurate and the actual need can be debated.
It is even more unlikely that a package needs to be unextracted when it defines neither a plugin nor a build system.
See the warning description above for more.