Sublime Forum

OverrideAudit

#1

OverrideAudit Version 1.0.0

After several months of late nights full of coding and harassing our very own @kingkeith excessively for feedback, design help and testing, I’m proud to announce the initial version of OverrideAudit! Huge props to Keith for the help and prodding during development! :+1:

The main goal of OverrideAudit is to try and fill some missing gaps in Sublime Text regarding package override files. OverrideAudit makes it easy to figure out what package overrides you have, how they’re different from the original file, and most importantly the ability to detect when the underlying file has been modified so that you can take the appropriate action.

See the README file for an OdatNurd-style wall of text with everything you ever wanted to know about the commands in the package and how they work, plus a few things you probably didn’t want to know and some you already did just to round things out.

The short synopsis of current features is:

  • Show all currently installed packages and where/how they are installed, including indications of which are ignored and which are dependencies
  • Show all override files that exist, optionally filtered to display only those that are out of date
  • Automatic checks on sublime and package upgrade to see if any overrides are out of date
  • Easily open and diff an override, flip between the two as you make edits or delete if you no longer need it
  • Generate bulk diffs of all overrides in any or all packages at once to get an overview of your override situation
  • Things I’m forgetting

There are still more features to come but I wanted to get an initial build out there and into the hands of everyone to get the ball rolling.

OverrideAudit supports Sublime Text 3 only, but covers Windows, MacOS and Linux versions. I’ve endeavoured to perform full testing on all features across all three platforms, but some little issues may have slipped between the cracks.

If you have any problems or feature requests, please check in with the GitHub issue page for OverrideAudit.

“I’m currently working on an introductory video”, he said before coming back to edit the post to include this YouTube link to an introductory video:

13 Likes

CSS value completion based on property
PHP syntax highlighting variables within double quotes
Where to find preferences for "copy path"
How to automatically scroll build output to the top?
What is the shortcut for going to the current cursor position?
Can't find ruby.sublime-build
#2

I already can’t live without this package <3

1 Like

#3

OverrideAudit Version 1.0.1

Work is still progressing on the feature list, with this release being a small interim maintenance release to fix a couple of issues that were uncovered during the first week after release.

If you’re using the package and have any thoughts, comments or questions please feel free to weigh in with them, either on the issue tracker for feature requests and bug reports or here for everything else. Your input will help guide the evolution of OverrideAudit.

Changes made in this version:

  • Fix display of mixed path separators between packages and their overrides in some situations (#14)
  • Disable word wrap by default in reports
  • Enhanced integration with manually opened override files (e.g. via PackageResourceViewer)
  • New config option “save_on_diff” to automatically save changes before performing a diff
  • Swap “Override View” with “Edit View” in some commands and tab titles for clarity
1 Like

#4

That’s really an awesome package! Thanks a lot!!

Your video makes it even better, just one detail: open the readme. Is there any reason you don’t use ReadmePlease, or you just don’t know about it?

It would prevent having inconsistent items in the command palette to open packages’ README.

1 Like

#5

Thank you for the kind words, sir!

I know about ReamePlease but I don’t personally use it, so mentioning it in the video never occurred to me.

Mostly the decision to include that command in the command palette instead of just in the menu was to be a subtle reminder to anyone that looked for OverrideAudit (or just one of those words) to find the commands that there is documentation available to coax them into reading it.

1 Like

#6

OverrideAudit Version 1.1.0

This release brings some performance enhancements and some bug fixes as well as the ability to “freshen” an expired override or overrides to update their local modification times without having to manually open and save them.

As always, if you have any thoughts, comments, questions or issues please free to weigh in.

Changes made in this version:

  • Implemented the ability to “freshen” a single expired override or all expired overrides in a package (#15). See the GIF below.
  • Implement the ability to show the diff header when a diff contains no changes (#18).
  • Fix a filename case issue on Windows/MacOS where opening an override from a package folder with an incorrect case would not enable the commands to edit or diff that override.
  • Internal performance enhancements in package scanning to increase performance on some commands for users with a large number of packages installed.

The new freshen functionality is currently exposed via the context menu. Invoking it over a package will touch all of the expired files in that package (leaving all non-expired files alone), while doing it for a single override will touch only that file.

As files are successfully touched, their expiration mark ([X]) is removed from them. The status bar will tell you the final result of the operation and the console lists all files that were freshened.

2 Likes

#7

Thank you for this package!

2 Likes

#8

Yep, this is really impressive and useful. Great quality plugin!

4 Likes

#9

All the written and video material explaining how this plugin works is great, except…

:electric_plug: WHAT IS AN OVERRIDE?

So far as I know, I have never seen one or even been in the same room. So maybe at the bottom of this page, in the section titled TERMINOLOGY ((please)).

https://packagecontrol.io/packages/OverrideAudit

1 Like

#10

I’m actually working on some more proper (and complete) documentation along with some more video explanations right now as a matter of fact. This particular omission is one of the things I’ve focused on. No ETA at the moment for when it goes live, though (busy bee at the moment).

1 Like

#11

OverrideAudit version 1.1.2

After only 495 days, another release of OverrideAudit! They said it couldn’t be done (actually, they probably said it wouldn’t be done), but here we are. Note that there was a version 1.1.1, but it wasn’t announced here due to happening hours after version 1.1.0 to fix a stray debug log that was spamming the console.

Changes made in this version:

  • Fix a bug in save_on_diff handling whereby in certain cases an override buffer tab might visually appear unsaved even though the contents were indeed saved prior to the diff happening.

  • Fix a bug introduced in 1.1.0 while fixing #24, in which text in reports telling you that there are no overrides would be treated as an override file name.

  • Improved detection of packages that are dependency packages that are under development, which do not use the same metadata file as installed dependencies do (#25).

  • The menu item and command palette entry that used to open the README file now opens the online documentation instead (which includes a section on overrides).

The next set of planned changes is the ability to run an external diff tool on overrides. This may also include integration with Sublimerge (the package, not the SublimeHQ Git tool) for a complete in-Sublime experience for those that use that package.

Note: The overall goal in the near term is to sunset the 1.x series in favour of a newer 2.x series (already in development), which has undergone a complete refactor to make code additions easier.

Part of this change will be increasing the minimum supported build of Sublime Text supported so that it’s possible to take advantage of newer features not available in older builds.

3 Likes

#12

OverrideAudit version 1.2.0

I’m pleased to announce that OA version 1.2.0 is now available, with the first version of the previously mentioned external diff support.

Changes made in this version:

  • Implement the ability to open an override diff in an external diff tool via the external_diff setting. This command is currently only available from the command palette and the context menu of override diff views.

The new functionality is controlled via a new external_diff setting in your OverrideAudit.sublime-settings file. The default value is false, which disables the command entirely. To enable it, set this setting to a JSON object with a shell_cmd that specifies the appropriate command line.

The setting value supports the keys shell_cmd, working_dir and env, which work as they do in sublime-build files. Additionally the platform keys linux, osx and windows allow you to alter options on a platform by platform basis if needed… The standard sublime-build variables are available as well as $override and $base which expand out to the full filenames of the override and base files respectively.

An example value for this setting might be the following, which demonstrates having a custom external tool for all platforms, and modifying the PATH on windows using the env key.

"external_diff": 
{
    "linux": {
        "shell_cmd": "meld \"${base}\" \"${override}\""
    },

    "osx": {
        "shell_cmd": "opendiff \"${base}\" \"${override}\""
    },

    "windows": {
        "shell_cmd": "bcompare.exe \"${base}\" \"${override}\"",
        "env": {
            "PATH": "$PATH;D:/Beyond Compare 4/"
        },
    }
}

All comments and bug reports welcome. Note also that there are still further planned enhancements to be made here (including Sublimerge 3 support).

2 Likes

#13

OverrideAudit version 1.2.1

Without wanting to seem overly spammy regarding package updates, it behooves me to point out that version 1.2.1 has just released. Barring any horrible bugs or unseen omissions, this will be the last release of the 1.x series in OverrideAudit and development will now proceed on the 2.x series instead.

As a pre-warning, the minimum supported build of Sublime is going to increase with version 2. For those that might have customized menus or key bindings, the underlying commands have been changed to make updates and additions to the code easier.

There is currently no ETA on when the first version of 2.x will drop.

Without further ado, changes made in this version:

  • Support using Sublimerge Pro or Sublimerge 3 as the external diff tool by setting external_diff to the string "sublimerge".

  • Improve detection of an invalid external_diff setting that could lead to the command being enabled when it should not be.

  • Log to the console when the tempoary files created during an external diff are removed

The big change here is the ability to set the external_diff setting to the string "sublimerge" in order to use one of the Sublimerge packages to perform the external diff. One of those packages needs to be installed (and enabled); otherwise the setting will be treated as if it was set to false.

2 Likes

#14

OverrideAudit version 1.2.2 / 2.0.0

Yes, you read that right, two new versions of OverrideAudit released today, to coincide with yesterday’s official release of Sublime Text 3.2. Double the fun? What’s going on here?

As mentioned previously, the overall plan was to replace the existing version of OverrideAudit with a version that is easier to maintain and extend for future development. Primarily this is because as my first official package, the code layout was not as good as it could have been; I’ve learned a lot since then.

This also provides a key opportunity to bump the minimum required version of Sublime Text that the package supports to version 3.2, which allows the package to use “newer” features like phantoms, hover popups, the new command palette input handlers and the mini_diff functionality to do some (hopefully) cool things that were not easily done previously due to having to support older versions of Sublime.

So, version 1.2.2 is functionally identical to build 1.2.1 and is the last version that will be released supporting older versions of Sublime. It’s here as a gentle reminder to anyone running an older build that there are newer versions available.

Apart from some minor cosmetic differences, Version 2.0.0 is outwardly identical to version 1.2.1 as well. Behind the scenes a lot has been changed, streamlined and reorganized. The thing that makes this a 2.x release is that due to the code refactoring, some command names have been renamed (or in some cases split into several commands instead).

This is only of importance to anyone that has created their own customized key bindings and such based on OA commands, which will require some tweaking to get back up and running. A full list of the commands that have had their names changed is listed in the change log for this release.

From here, exciting things are afoot in the 2.x series!

3 Likes

#15

OverrideAudit 2.1.0

Hot off the presses is a new release of OverrideAudit with some bug fixes and some new features as well. See the CHANGELOG for full information on this release. The highlights are:

  • New commands for creating an override or converting a view opened by View Package File into an override. This works similarly to how PackageResourceViewer does the same thing, with some tweaks. Most notably the candidate list only shows packages that can contain overrides and only shows resources that aren’t already overridden.

  • New command to revert an override back to the packed content without deleting it (requested by @kingkeith); handy if you want to redo an override from scratch or temporarily go back to a known state for troubleshooting.

  • Support for Incremental Diff in override views (enabled by default). The diff tracks changes based on the underlying package file, so you can easily navigate changes, revert them, or view the diff hunks inline while working

  • Files in a package that appear in Packages but not in that package’s sublime-package file show up in the Override and Diff reports annotated with a [?] mark. This lets you track when files that used to be overrides may no longer be required as well as tracking your own additions to packages. This was requested by @michaelblyons.

image

  • Hovering the mouse over a package name in any report shows you a popup with package meta information and applicable commands. The information is more detailed in Override or Diff reports because those reports introspect the contents of the package.


The following video also goes over the details of the new features and how they work. As always, any suggestions or bug reports welcome (to add to the minor bug that I noticed almost immediately after pressing the big green “Release” button, because that’s apparently how I roll).

6 Likes