Trending source files for iOS shows even split between Objective-C and C.

Issue #192 resolved
Former user created an issue

I have been working on an install of RhodeCode for us. I noticed that every single iOS project; which is a lot as that is all we do. Nearly all our projects only include Objective-C. Interestingly I have noticed that according to the "Trending Source" stats, it says 51% C and 49% Objective-C. Which is wrong for all of our projects.

Comments (11)

  1. Former user Account Deleted

    I supposed the "C" language is .h and "Objective-C" are the .m files. That would make sense. Anyway to change this? Configure it? Maybe this is just a regular expression or something that can be fixed easy.... ?

  2. Marcin Kuzminski repo owner

    Ok in general it's very hard to say if .h file is objective c or C without checking the content, RhodeCode uses pygments to determine what mimetype is a file. <pre> In [2]: rhodecode.lib.LANGUAGES_EXTENSIONS_MAP['m'] Out[2]: ['Mason', 'Matlab', 'ObjectiveC']

    In [2]: rhodecode.lib.LANGUAGES_EXTENSIONS_MAP['m'] Out[2]: ['Mason', 'Matlab', 'ObjectiveC']


    You can edit it here for 1.1.8:

  3. Former user Account Deleted


    I guess, it would require more work in general. Something like checking if an Xcode project file exists (which sometimes isn't' enough.). Safest would be evaluating if the .h file has another file name with a .cpp / .c extension instead of .m file extension.

    EX: FILENAME.h and a FILENAME.m are associated and are definitely Objective-C; at least in statistics terms.

    Of course that will get touchy too. Some people (including us) mix C in Objective-C; particularly with blocks. But since those stats are generally speaking, i'd personally prefer it to just default that file to Objective-C.

    Solution? I dunno; maybe leave it as a configuration setting and document for others (like myself) to change. But for now I appreciate you showing me the file where I can do that if I so choose. :)

  4. Marcin Kuzminski repo owner

    Another idea would be to create project type, So if you set a project typed objective-c it would alter the extension map in such way that .h will point to obj-c.

    Well currently i'll let admins handle that map manually

  5. Former user Account Deleted

    I like the idea of the project type. Makes total sense and I would think would be the simplest to code for (but I am not a committer so who am I to say).

    I'll play with the mapping manually. Hope to see something better in the future though.

  6. slestak

    What about a project that involves different technologies? My ERP project contains Unibasic (from Rocket Software) and python. The python is in the repo, but in a bin dir and also a python-modules dir. The Unibasic code has no usable extension.

    Should this really be an extension or enhancement to Pygments only?

  7. Marcin Kuzminski repo owner

    In rhodecode 1.3.4 there is an extension module that allows to configure the mappings, without any changes to code. So this issue can be closed

  8. Log in to comment