Skip to content

Don't mark SVG files as source - #702

Merged
pombredanne merged 1 commit into
aboutcode-org:developfrom
jpopelka:svg-is-not-source
Jul 27, 2017
Merged

pombredanne merged 1 commit into
aboutcode-org:developfrom
jpopelka:svg-is-not-source

Conversation

@jpopelka

Copy link
Copy Markdown
Contributor

SVG file is XML and the only (I guess) XML that we want to mark as source is maven's pom.xml

Signed-off-by: Jiri Popelka <jpopelka@redhat.com>
@pombredanne

Copy link
Copy Markdown
Member

Thanks!
Actually there may be also .pom and .Net .xaml and a good bunch ASP-related things and code from android .xml files... which could be considered to be source code .... this is unfortunately not straightforward!

The only sane way I know of to decide what a given xml file really is "in the wild" is to parse it and then assert some things based on its structure and possible schema (which is what used to/is done be done in Eclipse to recognize/describe what an XML file really is for instance here (https://github.com/eclipse/eclipse.platform/blob/3dce93196b299c5d1852d9a8fbe308b6fc42b32f/ant/org.eclipse.ant.core/src/org/eclipse/ant/internal/core/contentDescriber/AntBuildfileContentDescriber.java) )..

Now on the other hand large XML data files are legions and a curse. And tagging them as sources upfront is mostly counter productive.

Also I would likely consider a pom.xml not as source code, but instead as a package manifest and build script of sorts, the same way an RPM spec file or Debian control files would be manifests.

So with all this said, I have no issue with your proposed change... but in the end this would need to be refined with the upcoming #426 for a higher level file classification (and then I would also likely include Github linguist or its Python port(https://github.com/douban/linguist/network) )
And this is a classification that could then be used to drive and configure what should be or not be scanned.

@codecov

codecov Bot commented Jul 26, 2017

Copy link
Copy Markdown

Codecov Report

Merging #702 into develop will decrease coverage by 0.45%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #702      +/-   ##
===========================================
- Coverage    77.87%   77.41%   -0.46%     
===========================================
  Files           86       86              
  Lines        10796    10796              
===========================================
- Hits          8407     8358      -49     
- Misses        2389     2438      +49
Impacted Files Coverage Δ
src/typecode/contenttype.py 84.8% <100%> (-0.36%) ⬇️
src/scancode/api.py 44.28% <0%> (-34.29%) ⬇️
src/scancode/cli.py 90.8% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d1bfba...bff37e7. Read the comment docs.

@pombredanne

Copy link
Copy Markdown
Member

Mreging... Thanks again!

@jpopelka
jpopelka deleted the svg-is-not-source branch July 27, 2017 08:34
@jpopelka

Copy link
Copy Markdown
Contributor Author

Thank you for the description and the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants