Opened 3 months ago

Last modified 2 months ago

#31713 new enhancement

Automatically run the autostyle scripts before every commit

Reported by: teor Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: #29226 Points:
Reviewer: Sponsor: Sponsor31-can

Description (last modified by teor)

Let's try out our auto-formatting workflow by running:
scripts/maint/rectify_include_paths.py .
before every commit.

We occasionally miss include paths:
https://github.com/torproject/tor/pull/1319/commits/a90d1918af5d2b6c6e6dd2c0797f8a63d4042bfa

We should only ever run auto-formatting on master.

Edited to add:

We'll need to use a similar strategy to practracker, where we check for the presence of a file before running the autostyle scripts.

We can't use "make autostyle" directly, because some commit directories haven't run configure, so they don't have a Makefile. Instead, we should do what we do with all the other hook scripts, and copy the code from "make autostyle" to the hook. (Or even better, create a style script, and call it from "make autostyle" and the hook.)

Child Tickets

TicketTypeStatusOwnerSummary
#30991enhancementnewAuto-tabify makefiles? complain about mistabbed makefiles?
#31759defectclosednickmMake "annotate_ifdef_directives" script comply with line-width limits
#31891defectclosedmake autostyle doesn't work when building outside the source tree
#32282tasknewAvoid regressions to raw log mask calculations

Change History (4)

comment:1 Changed 3 months ago by nickm

Another possibility here is to run "make autostyle", which runs rectify_include_paths and several other autoformatters.

comment:2 Changed 3 months ago by teor

Yes, let's do that, and then we'll shake out a lot of the bugs in autostyling before the big restyle.

comment:3 Changed 2 months ago by teor

Summary: Automatically rectify include paths before every commitAutomatically run "make autostyle" before every commit

comment:4 Changed 2 months ago by teor

Description: modified (diff)
Summary: Automatically run "make autostyle" before every commitAutomatically run the autostyle scripts before every commit

We'll need to use a similar strategy to practracker, where we check for the presence of a file before running the autostyle scripts.

We can't use "make autostyle" directly, because some commit directories haven't run configure, so they don't have a Makefile. Instead, we should do what we do with all the other hook scripts, and copy the code from "make autostyle" to the hook. (Or even better, create a style script, and call it from "make autostyle" and the hook.)

Note: See TracTickets for help on using tickets.