All,

After Christian reminded me about svn:eol-style settings, I thought I'd look 
to see what was supposed to be set vs. what was set in the the codebase as a 
whole.  A search on t.e.o's wiki for 'eol-style' didn't turn up anything, so 
I figured I'd better ask.

I wrote a rough utility to show files by file extension with what their 
svn:eol-style is.[1]

Quick summary of what we currently have (where there's more than one file):
100% of .py   are 'native'
 69% of .html are 'native'
 93% of .css  are 'native'
 72% of .js   are 'native'
 83% of .rss  are 'native'
100% of .png  are unset
100% of .gif  are unset
100% of .ini  are unset
.txt are 1 unset, 1 CRLF, 2 native.
Files without extensions are a mix of unset and native, and inconsistent with 
things such as READMEs.

Based on this, am I correct in concluding that the following filetypes should 
always be set to 'native'?
.py .html .css .js .rss
README shellscripts

I suspect all those .ini's I added should also be 'native'?

Is the above correct?  If so, I'll update TracDev/CodingStyle#Miscellaneous.

Eli

[1]
#!/usr/bin/python
import os
from subprocess import call, Popen, PIPE
from pprint import pprint

if __name__ == '__main__':
    if not os.path.exists('svnlisting'):
        call('svn ls -R | grep -v -e "/$" > svnlisting', shell=True)
    filenames = [line.rstrip() for line in open('svnlisting').readlines()]

    eol_style_stats = {}

    for filename in filenames:
        eol = Popen(['svn', 'propget', 'svn:eol-style', filename], 
stdout=PIPE).stdout.read()
        if '.' in filename:
            ext = filename.split('.')[-1]
        else:
            ext = ''

        if ext not in eol_style_stats:
            eol_style_stats[ext] = {}
        ext_info = eol_style_stats[ext]
        if eol not in ext_info:
            ext_info[eol] = {'count':0, 'files':[]}

        eol_stats = ext_info[eol]
        eol_stats['count'] += 1
        eol_stats['files'].append(filename)

    pprint(eol_style_stats)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to