[ 
https://issues.apache.org/jira/browse/MESOS-9630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16932299#comment-16932299
 ] 

Benjamin Bannier commented on MESOS-9630:
-----------------------------------------

The following patches have landed on {{master}} (1.10-dev):
{noformat}
commit fb467a03cb8a5bde5147dc06ca6b73c9df04ff48
Author: Benjamin Bannier <bbann...@apache.org>
Date:   Wed Sep 18 11:37:19 2019 +0200

    Enabled a number of additional pre-commit checks.
    
    This patch enables checkers for well-formed YAML and JSON, and a linter
    which checks that all executable scripts have a valid shebang line.
    
    Review: https://reviews.apache.org/r/71209/

commit 2af339668fd90212999bae06a050a05824f2971e
Author: Benjamin Bannier <bbann...@apache.org>
Date:   Wed Sep 18 11:37:18 2019 +0200

    Revert "Updated cpplint to be compatible with Python 3."
    
    This reverts commit 89db66e3df831eaa50fffb4149a3894097505c14.
    
    This patch was necessary when we were running cpplint in the python3
    environment used e.g., also for bindings and other scripts. With
    pre-commit we have freedom to choose the Python environment needed so we
    can undo our adjustments here to stay closer to upstream.
    
    Review: https://reviews.apache.org/r/71208/

commit 3478e40c656160b8f08e0ad8c154289417bb6aaa
Author: Benjamin Bannier <bbann...@apache.org>
Date:   Wed Sep 18 11:37:17 2019 +0200

    Revert "Updated cpplint.py to be less verbose when there is no linting 
issue."
    
    This reverts commit c0f8f56d5a93f3fb870e448fedfd22f1491356ca.
    
    This patch was necessary when we were running cpplint via
    `support/mesos-style.py` to prevent it from cluttering up the hook
    output. When running under pre-commit linter output is not shown if no
    errors occur so we can undo our change to stay closer to upstream.
    
    Review: https://reviews.apache.org/r/71207/

commit 37d76fff124d28a0281b9231058bb1b92fc65abe
Author: Benjamin Bannier <bbann...@apache.org>
Date:   Wed Sep 18 11:37:15 2019 +0200

    Removed old mesos-style and references.
    
    This patch removes references to `support/mesos-style.py` which was
    replaced with a pre-commit setup in a previous commit. We also remove
    the tool itself.
    
    Review: https://reviews.apache.org/r/71206/

commit 454661dd0dcbb7a7bc87ac58ad74fd6dd04c5c15
Author: Benjamin Bannier <bbann...@apache.org>
Date:   Wed Sep 18 11:37:14 2019 +0200

    Switched commit hooks to pre-commit.
    
    This patch switches commit hooks to be orchestrated by the pre-commit
    tool mirroring the previous linters invoked through git commit
    hooks (orchestrated by `support/mesos-style.py` or standalone hooks).
    
    Using pre-commit removes the burden of maintaining
    `support/mesos-style.py`, making sure that hooks have the expected
    environment (e.g., Python version, Node installed). Additionally,
    upstream provides a number of additional linters which are not hard to
    add to Mesos' hooks.
    
    Review: https://reviews.apache.org/r/71205/

commit a138c2bd7cb3749f1dceb0e520e1138536abb531
Author: Benjamin Bannier <bbann...@apache.org>
Date:   Wed Sep 18 11:37:13 2019 +0200

    Added separate script to install developer setup.
    
    This patch breaks the installation of developer tools (i.e., linter
    configuration files and git hooks) out of `./bootstrap`. This not only
    simplifies and streamlines the setup, but will allow us to add
    developer-only features without breaking users who are just interested
    in building a distribution tarball.
    
    Review: https://reviews.apache.org/r/71299/

commit cbaca81a54720771662c119c80aec6101f120afc
Author: Benjamin Bannier <bbann...@apache.org>
Date:   Wed Sep 18 11:37:11 2019 +0200

    Added gitlint config.
    
    This patch adds a config for the gitlint tool which is slated to replace
    a custom commit-msg hook once we switch our hook infrastructure to the
    pre-commit tool.
    
    Review: https://reviews.apache.org/r/71204/

commit 526043b586da0201fd7e374197139e75b249e299
Author: Benjamin Bannier <bbann...@apache.org>
Date:   Wed Sep 18 11:37:10 2019 +0200

    Added check script to check for license headers.
    
    This check adds a script which validates that source files have valid
    license headers. This will allow us to reuse this functionality with
    e.g., the pre-commit tool.
    
    At the moment the code added here is not invoked from
    `support/mesos-style.py` since it will be removed in a follow-up commit.
    
    Review: https://reviews.apache.org/r/71203/

commit 2232d48ce5b07c4e094c6850cb28212495824110
Author: Benjamin Bannier <bbann...@apache.org>
Date:   Wed Sep 18 11:37:09 2019 +0200

    Moved cpplint configuration into dedicated file.
    
    With this change we not only reduce the amount of code in
    `support/mesos-style.py` in favor of a configuration supported by
    upstream, but we also make it easier to interoperate with editor
    integrations for cpplint.
    
    Review: https://reviews.apache.org/r/70096/
{noformat}

> Consider moving linter setup to pre-commit
> ------------------------------------------
>
>                 Key: MESOS-9630
>                 URL: https://issues.apache.org/jira/browse/MESOS-9630
>             Project: Mesos
>          Issue Type: Wish
>            Reporter: Benjamin Bannier
>            Assignee: Benjamin Bannier
>            Priority: Minor
>
> Mesos currently uses a mix of hand-crafted git commit hooks and mesos-style 
> to perform linting. While this has served us well our current approach also 
> has some drawbacks, e.g.,
>  * the linter setup is spread between hooks and {{support/mesos-style.py}}
>  * adding new linters can be cumbersome
>  * mesos-style.py uses a process where it creates a single virtualenv to 
> install linters in which is tie d to the source tree
>  * linter dependencies are only cached to an extent and it is easy to run 
> into a situation where one needs to update linter dependencies over the 
> network even though one has successfully linted a revision before
>  * {{support/mesos-style.py}} lacks a number of features, e.g., running over 
> only staged files, running linters in parallel for improved throughput, 
> running only specific linters or disabling certain linters, and the 
> parameterization of the linters is strongly coupled to implementation of the 
> style checker itself.
> The [pre-commit tool|https://pre-commit.com/] solves most of these issues and 
> using it in Mesos would not only allow us to get rid of tooling which is hard 
> to maintain, but also unlock other features. It is licensed under a MIT 
> license. We should consider moving our linting setup over to pre-commit.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to