Jump to content


Implementing a linter as a change-content trigger

trigger python

  • Please log in to reply
1 reply to this topic

#1 smyneni

smyneni

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 12 September 2020 - 05:57 AM

Hello,
I wrote a small python based linter that I would like to call whenever someone checks in a specific filetype.
I would like this to be run by a change-content trigger that will prevent a commit if the file fails the tests.

This linter will need to be able to read the contents or the specific file that is being updated.

Are there any examples on how to go about this? This could be a file that is checked in, or invoked from the perforce server.


My perforce server version:  P4D/LINUX26X86_64/2017.2/1760971 (2019/02/20)

Thank you,
_Sachin

#2 P4Jen

P4Jen

    Advanced Member

  • Staff Moderators
  • 158 posts

Posted 16 September 2020 - 04:39 PM

Hi,

There are some change-content trigger examples In the Helix Server admin guide:
  https://www.perforce...ts.content.html

Some example triggers are also located here:
  https://swarm.worksh...ham-p4triggers/

Kind regards,
Jen.






Also tagged with one or more of these keywords: trigger, python

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users