Skip to content

Resurrect Modelines package#9333

Merged
braver merged 1 commit intosublimehq:masterfrom
michaelblyons:package/modelines
Apr 1, 2026
Merged

Resurrect Modelines package#9333
braver merged 1 commit intosublimehq:masterfrom
michaelblyons:package/modelines

Conversation

@michaelblyons
Copy link
Copy Markdown
Contributor

@michaelblyons michaelblyons commented Mar 12, 2026

  • I am [represent] the package's author and/or maintainer. cc @Frizlab
  • I have read the docs.
  • I have tagged a release with a semver version number.
  • My package repo has a description and a README describing what it's for and how to use it.
  • My package doesn't add context menu entries. *
  • My package doesn't add key bindings. **
  • Any commands are available via the command palette.
  • Preferences and keybindings (if any) are listed in the menu and the command palette, and open in split view.
  • If my package is a syntax it doesn't also add a color scheme. ***
  • I use .gitattributes to exclude files from the package: images, test files, sublime-project/workspace.

This package is back from the dead! Credit to Frizlab.

I can't merge SublimeText/Modelines#9 to master without this change.1 Some of the checkmarks above are dependent on that merge. I'll tag an ST4 release when things are settled.2

Footnotes

  1. That's based on the very unlikely assumption that someone is using ST2, has this package installed, and has automatic updates from Package Control. 😆 But we'll pretend.

  2. Edit: I've tagged a prerelease for ST4. I'd like to save the big 2.0.0 tag for the merge commit or a messages.json update, but I can tag it now if it's necessary for the automated tests.

@github-actions
Copy link
Copy Markdown

Package Review

Channel Diff

Removed (none), changed Modelines, added (none).

Review for Modelines 1.1.0

2 failures:
- Unable to parse Python file
    File: setup.py
    Line: 62
    Exception: invalid syntax (setup.py, line 62)
- Unable to parse Python file
    File: sublime_modelines.py
    Line: 111
    Exception: multiple exception types must be parenthesized (sublime_modelines.py, line 111)

No warnings


For more details on the report messages (for example how to resolve them), go to:
https://github.com/packagecontrol/st_package_reviewer/wiki

Review for Modelines 2012.09.13.23.27.49

2 failures:
- Unable to parse Python file
    File: setup.py
    Line: 62
    Exception: invalid syntax (setup.py, line 62)
- Unable to parse Python file
    File: sublime_modelines.py
    Line: 110
    Exception: multiple exception types must be parenthesized (sublime_modelines.py, line 110)

No warnings


For more details on the report messages (for example how to resolve them), go to:
https://github.com/packagecontrol/st_package_reviewer/wiki

@michaelblyons michaelblyons marked this pull request as draft March 12, 2026 20:08
@michaelblyons michaelblyons marked this pull request as ready for review March 12, 2026 20:08
@michaelblyons
Copy link
Copy Markdown
Contributor Author

Okay, I've tagged a pre-merge Beta of SublimeText/Modelines#9.

Can I get the reviewer bot to try that one instead? 📦

@Frizlab
Copy link
Copy Markdown

Frizlab commented Mar 15, 2026

Is there anything I can do to move this forward?

@michaelblyons
Copy link
Copy Markdown
Contributor Author

Is there anything I can do to move this forward?

My understanding is that package changes with lots of Python functionality (i.e. not a color scheme, syntax, or snippet collection) take reviewer time, which is in short supply.

We could probably get a quicker merge on a PR that limits ST2 to tags rather than master. Then I could merge SublimeText/Modelines#9 safely and a subsequent PR for the ST4 tag series would at hopefully 🤞 get the automatic reviewer to look at the right tags.

But after Some Incidents ™️ in the past, packages get at least a security check to make sure they don't do anything nefarious. And sometimes additional code review.

@Frizlab
Copy link
Copy Markdown

Frizlab commented Mar 15, 2026

Understood. No worries, I am in no hurry (I have it installed locally anyways); just making sure it was not in limbo.
Thanks!

@braver
Copy link
Copy Markdown
Collaborator

braver commented Mar 17, 2026

The package reviewer script mostly looks at the tip of the default branch. That's in almost all cases the version we want to review. See also #9330 (comment). The repo layout is also a bit confusing for contributors if that's not the case... so while I'm inclined to take @michaelblyons 's word for it that the package is good, but I would love to run the bot on it anyway :)

As for my own very quick review, some notes:

  • The package is called "Modelines", but refers to itself in menus as "Sublime Modelines", where being inside Sublime the Sublime prefix is extra superfluous 😉
  • ... although maybe the settings file people might still have is already called "Sublime Modelines.sublime-settings" that can't be helped? Do we expect anyone to actually have used this all these years and are old settings still compatible even?

@braver braver added feedback provided The changes and package have been seen by a reviewer mergeable The channel changes are good but some action from the author is still needed labels Mar 17, 2026
@Frizlab
Copy link
Copy Markdown

Frizlab commented Mar 17, 2026

The package reviewer script mostly looks at the tip of the default branch.

Not sure if that helps (probably not), but I have updated the default branch of my fork to be the one I worked on, and that will be merged.

The package is called "Modelines", but refers to itself in menus as "Sublime Modelines"

The proper naming is indeed Modelines now, because I have added support for common modelines (VIM and Emacs). I can rename everything.
(The naming previously made sense because it was only supporting Sublime modelines.)

maybe the settings file people might still have is already called "Sublime Modelines.sublime-settings"

I think there were no settings file prior to my rewrite, so that will not be an issue.

@michaelblyons
Copy link
Copy Markdown
Contributor Author

@braver, would you like me to split this into a ST2 -> tags PR and a subsequent ST4 series PR? If that helps, I can do it.

@Frizlab
Copy link
Copy Markdown

Frizlab commented Mar 17, 2026

I have pushed the full renaming of “Sublime Modelines” to “Modelines.”
Please note that includes the installation instructions in the readme, which now ask to install “Modelines” instead of “SublimeModelines.” I don’t know if there are changes to be done elsewhere for these instructions to be true. (I can revert this specific change too, if it is an issue.)

@braver
Copy link
Copy Markdown
Collaborator

braver commented Mar 19, 2026

would you like me to split this into a ST2 -> tags PR and a subsequent ST4 series PR? If that helps, I can do it

Nah, probably won't matter.

@braver
Copy link
Copy Markdown
Collaborator

braver commented Mar 19, 2026

Let's see... with the default branch basically being what you want to ship, the tests should run (and pass 🤞🏻) if you rebase this PR on master.

@github-actions
Copy link
Copy Markdown

Package Review

Channel Diff

Removed (none), changed Modelines, added (none).

Review for Modelines master-7f703b8-2012.09.13.23.27.49

No notices

3 failures:
- Unable to parse Python file
    File: setup.py
    Line: 62
    Exception: invalid syntax (setup.py, line 62)
- Unable to parse Python file
    File: sublime_modelines.py
    Line: 110
    Exception: multiple exception types must be parenthesized (sublime_modelines.py, line 110)
- No semantic version tags found
    Repository: https://github.com/SublimeText/Modelines

No warnings


For more details on the report messages (for example how to resolve them), go to:
https://github.com/packagecontrol/st_package_reviewer/wiki

@michaelblyons
Copy link
Copy Markdown
Contributor Author

- No semantic version tags found
   Repository: https://github.com/SublimeText/Modelines

I don't think this check is working correctly. We have prefixed SemVer tags, but the CI isn't evaluating them. I'm not sure if that's because it's trying the pre-existing JSON state, or I have a typo, or it's not handling prefixes at all, or something else.

I would still prefer to run the tests against SublimeText/Modelines#9 before merging it into Modelines' master (probably irrational). I think there's a chance that I can get that if I split the PR into two parts, but it might still not work.

@braver
Copy link
Copy Markdown
Collaborator

braver commented Mar 20, 2026

The tests use our new crawler, so I assume it would be able to handle those kinds of prefixes. 🤷🏻‍♂️

What do you make of "invalid syntax (setup.py, line 62)"?

I would still prefer to run the tests against SublimeText/Modelines#9

You might be able to run the tests locally, ie. not the GitHub action wrapper but the tests themselves. I have done it before but couldn't get the current version to run for me anymore. Might just be that I don't know what I'm doing 😅

@michaelblyons
Copy link
Copy Markdown
Contributor Author

What do you make of "invalid syntax (setup.py, line 62)"?

This error is from a scan of the ST2 (!) code that is on Modelines master. The big rewrite hasn't been merged. Modelines is currently set in PCC to follow master not tags. If someone has it installed on ST2 (unlikely) and it's working, a merge of the new Modelines code would screw up their current system.

I merged a fix for the ST2 branch today, which hopefully isn't too much of a nuisance for the ST4 version. If you can see your way to merging #9339 to change PCC from master to tags, I can safely merge SublimeText/Modelines#9, rebase this PR without side effects, and get scanner output for the code we're trying to deploy.

If that's confusing, I can try to repeat it in a different way. But the upshot is that none of the scans by CI here have actually targeted the relevant package code.

@braver
Copy link
Copy Markdown
Collaborator

braver commented Mar 20, 2026

Got it... Honestly, it's an existing package. We don't test existing packages. My primary concern that packages have serious maintainers and that's certainly the case here.

I'm not against simply merging the latest greatest and ignoring tests. No need to do one change ahead of the other. Shall we just go ahead and merge this PR, ignore the other, and let you guys merge branches and tag releases at will going forward?

@michaelblyons
Copy link
Copy Markdown
Contributor Author

michaelblyons commented Mar 20, 2026

I'd honestly prefer you merge the other one first. I really do want the scan to be run in case I missed some best practice! 😅

I'm somewhat regretting my rigidity in not merging Frizlab's PR before opening this one.

@braver
Copy link
Copy Markdown
Collaborator

braver commented Mar 20, 2026

Done. Note by the way that the schema test fails because Will let his certificates expire. I handled that, but you need this PR rebased on master again (sorry!) to get the latest version of the tests.

@github-actions
Copy link
Copy Markdown

Package Review

Channel Diff

Removed (none), changed Modelines, added (none).

Review for Modelines master-7bd1747-2026.03.20.21.09.47

No notices

1 failures:
- No semantic version tags found
    Repository: https://github.com/SublimeText/Modelines

1 warnings:
- 'Main.sublime-menu' has no 'Settings' menu entry for 'Modelines'
    File: Main.sublime-menu


For more details on the report messages (for example how to resolve them), go to:
https://github.com/packagecontrol/st_package_reviewer/wiki

@michaelblyons
Copy link
Copy Markdown
Contributor Author

Done. Note by the way that the schema test fails because Will let his certificates expire. I handled that, but you need this PR rebased on master again (sorry!) to get the latest version of the tests.

Thank you! Things look decent to me.

1 failures:

Disputed and logged at kaste/st_package_reviewer#3

1 warnings:

  • 'Main.sublime-menu' has no 'Settings' menu entry for 'Modelines'
    File: Main.sublime-menu

I'm not exactly sure what it's looking for that isn't handled in our Main.sublime-menu ... Maybe it wants another level of nesting? That's my best guess with looking at this test case.

@braver
Copy link
Copy Markdown
Collaborator

braver commented Mar 21, 2026

Indeed, we expect the package entry ("Modelines") to have child entries for settings and keybindings, so your edit_settings command should be in a "Settings" item.

Scherm­afbeelding 2026-03-21 om 14 27 32

Edit: haha, that Change quotes example is old and bad 😅 But you get the point...

@michaelblyons
Copy link
Copy Markdown
Contributor Author

But if we don't have any key bindings, it's a useless extra nesting, no?

@braver
Copy link
Copy Markdown
Collaborator

braver commented Mar 21, 2026

Well it's consistent, which is useful in and of itself. It makes all entries in that menu the same: they open a sub menu. And you can add key bindings or a readme later on and everything would still be exactly where users expect them to be.

@braver
Copy link
Copy Markdown
Collaborator

braver commented Mar 21, 2026

I'm not sure I would've called that out in a review, I might not even notice it, if the test didn't reveal it. So put that down to the idiosyncrasies of a human in the loop. I do agree with the test as it is though.

@Frizlab
Copy link
Copy Markdown

Frizlab commented Mar 23, 2026

I will implement the change soon. I agree that consistency is important.

@Frizlab
Copy link
Copy Markdown

Frizlab commented Mar 23, 2026

Done in SublimeText/Modelines#15 (merged).

@Frizlab
Copy link
Copy Markdown

Frizlab commented Apr 1, 2026

Hi @braver, is there anything missing for this PR to move forward?

@braver
Copy link
Copy Markdown
Collaborator

braver commented Apr 1, 2026

It looks like your latest changes are not tagged yet, so I guess we're waiting for a 2.0 beta-04 tag :)

@michaelblyons
Copy link
Copy Markdown
Contributor Author

Oops. That would be on me. I'll sort it later today.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2026

Package Review

Channel Diff

Removed (none), changed Modelines, added (none).

Review for Modelines master-7d28b14-2026.03.24.21.16.32

No notices

1 failures:
- No semantic version tags found
    Repository: https://github.com/SublimeText/Modelines

No warnings


For more details on the report messages (for example how to resolve them), go to:
https://github.com/packagecontrol/st_package_reviewer/wiki

@braver braver merged commit 2e6bad6 into sublimehq:master Apr 1, 2026
2 of 3 checks passed
@michaelblyons
Copy link
Copy Markdown
Contributor Author

Thanks for everyone's patience! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feedback provided The changes and package have been seen by a reviewer mergeable The channel changes are good but some action from the author is still needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants