Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0043000Openbravo ERPA. Platformpublic2020-01-24 12:372020-02-14 09:32
jarmendariz 
cberner 
highmajorhave not tried
closedfixed 
5
 
3.0PR20Q2 
alostale
Core
No
0043000: Migrate current Mercurial hooks to Git hooks
Currently we provide Mercurial hooks to automatically check for javascript linting/formatting errors before creating a commit.
Git also support hooks in various stages [1], but with the different there can only be one script for each stage. It'd be convenient to have a mechanism to execute multiple scripts for the same hook.

[1] https://git-scm.com/docs/githooks [^]
* Modify a javascript file. For instance: modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
* Add a line that will cause a linting error:
var a = 1;
* Stage and create a commit

Before the commit is created, ESLint should run an notify there's an error.

No tags attached.
related to feature request 0041898 acknowledged Triage Platform Base support git 
Issue History
2020-01-24 12:37jarmendarizNew Issue
2020-01-24 12:37jarmendarizAssigned To => platform
2020-01-24 12:37jarmendarizModules => Core
2020-01-24 12:37jarmendarizTriggers an Emergency Pack => No
2020-01-24 12:45jarmendarizRelationship addedrelated to 0041898
2020-01-31 09:29alostaleNote Added: 0117397
2020-01-31 09:29alostaleAssigned Toplatform => cberner
2020-02-07 11:54hgbotCheckin
2020-02-07 11:54hgbotNote Added: 0117556
2020-02-07 11:54hgbotStatusnew => resolved
2020-02-07 11:54hgbotResolutionopen => fixed
2020-02-07 11:54hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/6140b72f414d17a85ffc31d292d71705fa4a01f9 [^]
2020-02-07 12:44cbernerReview Assigned To => alostale
2020-02-14 09:32alostaleStatusresolved => closed
2020-02-14 09:32alostaleFixed in Version => 3.0PR20Q2

Notes
(0117397)
alostale   
2020-01-31 09:29   
MR: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/37 [^]
(0117556)
hgbot   
2020-02-07 11:54   
Repository: erp/devel/pi
Changeset: 6140b72f414d17a85ffc31d292d71705fa4a01f9
Author: Cristian Berner <cristian.berner <at> openbravo.com>
Date: Mon Jan 27 17:04:20 2020 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/6140b72f414d17a85ffc31d292d71705fa4a01f9 [^]

Fixes ISSUE-43000: Adapted Mercurial hooks to be used in git

Hooks are also moved to a .githooks folder to have them grouped and ready
to be set as the project hooks folder running:

'git config core.hooksPath .gitHooks'

As there can be only one pre-commit script, a pre-commit.d folder were
created to have both scripts as an ordered list which will be executed in
order by the pre-commit script.

---
M modules/org.openbravo.client.kernel/jsformatter/README.md
M modules/org.openbravo.client.kernel/jslint/README.md
A .githooks/pre-commit
A .githooks/pre-commit.d/00-jslint
A .githooks/pre-commit.d/01-jsformatter
---