Page MenuHomeSoftware Heritage

Phabricator/plugin: Add support for commented links
ClosedPublic

Authored by ardumont on Apr 9 2019, 2:12 PM.

Diff Detail

Repository
R154 Limnoria plugins
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5430
Build 7356: arc lint + arc unit

Event Timeline

Transmit object_fragment to object formatter as well

So that they can build the right url

  • Phabricator/plugin: Add support for commented links
  • Refactor: Break out of the loop prior to parse some more the id
  • Refactor: Use regexp to fetch object type, id and fragment

@olasd i finally grasped what you meant, thanks.
I iterated over multiple implementations.
In the end, i chose to use regexp consistently.

  • Phabricator/plugin: Recognize object id even in lower case

Could you factorize this part:

url = full_XXX['uri']
if object_fragment is not None:
    url = '%s%s' % (url, object_fragment)

by moving it in get_object_by_phid?

Phabricator/plugin.py
224

Replace the last * by a ?, there's at most one fragment.

This revision is now accepted and ready to land.Apr 15 2019, 10:51 AM
Phabricator/plugin.py
230

@vlorentz asked for this, so the bot can hint even lowered-case object

ardumont added inline comments.
Phabricator/plugin.py
224

Right!

ardumont marked an inline comment as done.
  • phab/plugin: Change to match reality, there is at most 1 fragment
  • plugin: Factorize full uri computation in get_object_by_phid
This revision was automatically updated to reflect the committed changes.