Proposal to replace Clang Format with ESLint and Prettier in phosphor-webui

Ed Tanous ed.tanous at
Thu Jul 11 04:59:17 AEST 2019

On 7/10/19 10:17 AM, Derick wrote:
> Thanks Ed for the reviews and support on the GUI tools work! I ran into a
> roadblock with the call. I am not finding Prettier as an
> Ubuntu
> package and won't be able to make the call during the build process.

Not surprising;  Prettier is an npm package, not specific to Ubuntu.

sudo npm install --global prettier

Should give you the result you want.

> However,
> I am able to use a Git hook to test the code prior to commit and/or push.

That's great that this is available, but I'm not really comfortable if
it can't be enforced in CI.  That would mean someone needs to pull down
each commit and verify it manually.  That doesn't really scale IMO, and
considering that the incumbent (clang-format) can already integrate
properly, it's hard to justify going backwards.

> I added the npm scripts that can be called for testing and fixing (if
> auto-fixable)
> so that they can be run from the command line for anyone that doesn't
> Prettier
> integrated with their code editor (it even has VIM support). 

They'll still need to have it installed globally, which could be added
as part of the main webui install, but I'm not sure that would be worth it.

>  I have these changes in the Gerrit
> review
> and am hoping that this is an acceptable solution. 

My main sticking point is the significant manual testing that's going to
have to take place, for a relatively modest increase in productivity.
If that can be resolved, I would support you moving this change forward.

More information about the openbmc mailing list