github-linguist / linguist

Language Savant. If your repository's language is being reported incorrectly, send us a pull request!
MIT License
12.13k stars 4.2k forks source link

*.sch is both Eagle and KiCad schematics file #2187

Closed Miceuz closed 9 years ago

Miceuz commented 9 years ago

Now *.sch files are classified as Eagle files.

Miceuz commented 9 years ago

Repo in question - https://github.com/Miceuz/ultimate-temperature-controller

Miceuz commented 9 years ago

Kicad sch file is not XML, it starts like this:

EESchema Schematic File Version 2

pchaigno commented 9 years ago

@Miceuz I see that both your files have a lot of lines starting with LIBS. Is that common in the KiCad format or is it just in your files? (I'm trying to see if we could use your files to train the classifier to recognize .sch files as KiCad.)

Miceuz commented 9 years ago

@pchaigno In fact it depends on how much libs are used int particular project, might be a single library containing a resistor. But the file has a unique header - EESchema Schematic File Version 2 on another hand $Comp and $EndComp is a unique feature.

pchaigno commented 9 years ago

Okay, thanks for the clarification! I'll see what I can do. The header could surely be used for a heuristic rule but we try to only use those if the Bayesian classifier can't do the job.

mithat commented 9 years ago

@pchaigno I've got a few KiCad designs that you can use for training the classifier if it's helpful:

pchaigno commented 9 years ago

@Miceuz @mithat Do you know a Textmate bundle or Sublime Text package that could be used to highlight KiCad code?

mithat commented 9 years ago

@pchaigno I don't know of such a bundle. But I found file format documentation for KiCad at http://bazaar.launchpad.net/~kicad-developers/kicad/doc/files/head:/doc/help/file_formats/docs_src/ if that's helpful.

Also, I remembered that the *.sch extension is used by another FLOSS EDA suite, the gEDA project. Its file format documentation is at http://wiki.geda-project.org/geda:file_format_spec.

pchaigno commented 9 years ago

2309 should fix this ;)

arfon commented 9 years ago

This will be fixed in the next release of Linguist.

Alhadis commented 7 years ago

@Miceuz @mithat Do you know a Textmate bundle or Sublime Text package that could be used to highlight KiCad code?

I wrote one for all three languages:

What the actual hell am I doing with my life.