Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Issue 2842064: Add python script that can add "#pragma once" to all our files. (Closed)

Created:
10 years, 5 months ago by Nico
Modified:
9 years, 7 months ago
CC:
chromium-reviews, pam+watch_chromium.org
Visibility:
Public.

Description

Add python script that can add "#pragma once" to all our files. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=53271

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -0 lines) Patch
A tools/pragmaonce/pragmaonce.py View 1 1 chunk +45 lines, -0 lines 6 comments Download

Messages

Total messages: 5 (0 generated)
Nico
Not the prettiest, but seems to work.
10 years, 5 months ago (2010-07-21 23:05:08 UTC) #1
Elliot Glaysher
On 2010/07/21 23:05:08, Nico wrote: > Not the prettiest, but seems to work. As scripts ...
10 years, 5 months ago (2010-07-21 23:07:58 UTC) #2
Evan Martin
I feel like this might've been a one-liner sed script. I'm just not sure of ...
10 years, 5 months ago (2010-07-22 00:44:54 UTC) #3
Mark Mentovai
http://codereview.chromium.org/2842064/diff/5001/6001 File tools/pragmaonce/pragmaonce.py (right): http://codereview.chromium.org/2842064/diff/5001/6001#newcode18 tools/pragmaonce/pragmaonce.py:18: m1 = re.match(r'^#ifndef ([A-Z_]+)', lines[i]) You should likely permit ...
10 years, 5 months ago (2010-07-22 02:48:38 UTC) #4
Nico
10 years, 5 months ago (2010-07-26 18:54:58 UTC) #5
Doing stuff across multiple lines in sed is very cumbersome as far as I remember
(need to add stuff to registers and stuff – if you know a simpler way, please
tell me).

CL that addresses comments is at http://codereview.chromium.org/3056020

http://codereview.chromium.org/2842064/diff/5001/6001
File tools/pragmaonce/pragmaonce.py (right):

http://codereview.chromium.org/2842064/diff/5001/6001#newcode1
tools/pragmaonce/pragmaonce.py:1: import re
On 2010/07/22 00:44:54, Evan Martin wrote:
> Copyright header plz thx.

Presubmit caught this before committing.

http://codereview.chromium.org/2842064/diff/5001/6001#newcode6
tools/pragmaonce/pragmaonce.py:6: #   find chrome -name '*.h' -exec  python
tools/pragmaonce/pragmaonce.py {} \;
On 2010/07/22 00:44:54, Evan Martin wrote:
> nit: extra double space

Done.

http://codereview.chromium.org/2842064/diff/5001/6001#newcode18
tools/pragmaonce/pragmaonce.py:18: m1 = re.match(r'^#ifndef ([A-Z_]+)',
lines[i])
On 2010/07/22 02:48:38, Mark Mentovai wrote:
> You should likely permit digits too.

Since I don't have a "$" at the end, this happened to work. Added digits and a
$.

Powered by Google App Engine
This is Rietveld 408576698