Changes between Initial Version and Version 19 of Ticket #30404


Ignore:
Timestamp:
11/08/20 14:31:39 (11 months ago)
Author:
gh-tobiasdiez
Comment:

I've now added relint. This is now ready for review.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30404

    • Property Status changed from new to needs_review
    • Property Work issues changed from to merge dependencies
    • Property Authors changed from to Tobias Diez
    • Property Cc embray slelievre added
    • Property Dependencies changed from to #30408, #30361
    • Property Branch changed from to public/build/lintGithub
    • Property Milestone changed from sage-9.2 to sage-9.3
    • Property Keywords code style lint added
    • Property Commit changed from to 51828da28a18b1c0d161f09a91417abd9f652088
    • Property Type changed from PLEASE CHANGE to enhancement
  • Ticket #30404 – Description

    initial v19  
    11Currently, the linters (pycodestyle, pyflakes, ...) run as plugins of patchbot. This has a few disadvantages: a) the lint results depend on the version of the tools installed by the owner of the patchbot b) it takes quite some time until the results are available and c) you need people to run the patchbot.
    22
    3 At https://github.com/sagemath/sage/pull/95 I added the pyright and pycodestyle checks as Github actions. They run really fast (about 10min), have reliable results as the version of the linters can be controlled and uses Github server instead of people's machines.
     3This ticket adds pyright, relint and pycodestyle checks as Github actions. They run really fast (about 2min), have reliable results as the version of the linters can be controlled and uses Github server instead of people's machines.
    44
    5 The pyright check currently fails, as there is no configuration file (which is added in #30361). The pycodestyle check also fails as there are currently over 600 errors that for some reason were missed by the patchbot (see https://github.com/tobiasdiez/sage/runs/1007221345?check_suite_focus=true) (I only activated those rules that are also run by the patchbot).
     5Although only those rules are activated that are also run by the patchbot, the pycodestyle and relint checks currently fail with a lot of errors. See https://github.com/tobiasdiez/sage/actions/runs/352364668. Thus, making these tests pass requires more work by the sage community.
    66
    7 **Question 1:** What should be done about these errors?
     7What is left to do is to add the integration of the github action output to trac. That can be done as follows:
     81. Sync trac branches to sagetrac-mirror (by post-commit hook)
     92. Activate github actions in the sagetrac-mirror github repo
     103. Add the following code to either the patchbot output or to the trac ticket header (next to the patchbot button)
     11{{{
     12<a href="https://github.com/sagemath/sagetrac-mirror/actions?query=workflow%3ALint+branch%3BRANCH"><img src="https://github.com/sagemath/sagetrac-mirror/workflows/Lint/badge.svg?branch=BRANCH&event=push"/></a>
     13}}}
     14Here BRANCH needs to be replaced by the branch.
     15Giving something similar to
    816
    9 **Question 2:** What is the best way apply the Github actions to new code contributions?
     17[[Image(https://github.com/tobiasdiez/sage/workflows/Lint/badge.svg?branch=patch-2&event=push)]]
    1018
    11 ''Option A:'' Switch from trac to pull requests via Github (refs #30363)
    12 
    13 ''Option B:'' Mirror every branch on trac to Github (it's not clear to me how to best integrate the results from the Github actions then here on trac; one option would be to use the Github API to create pull requests automatically for each trac ticket)
    14 
    15 ''Option C:'' Integrate the Github actions directly in the patchbot (how?)
     19As this requires rights to the github repo and trac config, I cannot do this and have to leave it to somebody else.