Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0043292Openbravo ERPA. Platformpublic2020-02-21 14:302020-05-08 14:09
cberner 
cberner 
normalminoralways
closedfixed 
5
 
PR20Q3 
alostale
Core
No
0043292: Git hooks for jslint and jsformatter don't work on files with both staged and ustaged changes
Git hooks migrated from mercurial for jslint and jsformatter use the current file in the workspace when files are staged instead of the staged file.

So if there are files that have both staged changes and unstaged changes, the file checked by the linter will be the one that contains both staged and unstaged changes, instead of only the staged changes. So it will fail to commit if the unstaged changes break the linter.

It also fails with git commit --amend, doesn't do any checking in those cases.
In description
When passing the linter/formatter only take into account the staged files, using git show :file should work.
No tags attached.
Issue History
2020-02-21 14:30cbernerNew Issue
2020-02-21 14:30cbernerAssigned To => cberner
2020-02-21 14:30cbernerModules => Core
2020-02-21 14:30cbernerTriggers an Emergency Pack => No
2020-03-03 15:42cbernerDescription Updatedbug_revision_view_page.php?rev_id=20508#r20508
2020-04-23 10:18cbernerStatusnew => scheduled
2020-04-23 10:18cbernerNote Added: 0119350
2020-05-05 16:28hgbotCheckin
2020-05-05 16:28hgbotNote Added: 0119588
2020-05-05 16:28hgbotStatusscheduled => resolved
2020-05-05 16:28hgbotResolutionopen => fixed
2020-05-05 16:28hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ff45077d275ede2fec6489bcc6e3c12e20a18c15 [^]
2020-05-08 14:09alostaleReview Assigned To => alostale
2020-05-08 14:09alostaleStatusresolved => closed
2020-05-08 14:09alostaleFixed in Version => 3.0PR20Q3

Notes
(0119350)
cberner   
2020-04-23 10:18   
Merge Request: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/63 [^]
(0119588)
hgbot   
2020-05-05 16:28   
Repository: erp/devel/pi
Changeset: ff45077d275ede2fec6489bcc6e3c12e20a18c15
Author: Cristian Berner <cristian.berner <at> openbravo.com>
Date: Mon Apr 20 17:06:53 2020 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/ff45077d275ede2fec6489bcc6e3c12e20a18c15 [^]

Fixes ISSUE-43292: Jslint and jsformatter git hooks work on staged changes only

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