nextflow-io / patterns

A curated collection of Nextflow implementation patterns
http://nextflow-io.github.io/patterns/
MIT License
332 stars 71 forks source link

Groovy syntax on GitHub #3

Closed ewels closed 8 years ago

ewels commented 8 years ago

You can get GitHub to play nicely with the NextFlow scripts file extensions with these two tricks:

Add the following to the top of every .nf script: (does syntax highlighting)

vim: syntax=groovy
-*- mode: groovy;-*-

Create a file called .gitattributes with the following: (changes the coloured bar at the top of the repo to say 100% Groovy instead of 100% Shell.

*.nf linguist-language=Groovy

Hope this helps! It was annoying me on our NextFlow repos 😉

pditommaso commented 8 years ago

Nice! I'm bit confused with the first tip. It does not break the nextflow script if you put that at the top of the file?

ewels commented 8 years ago

Sorry, just near the top of the file. eg: https://github.com/SciLifeLab/NGI-RNAseq/blob/master/main.nf#L3-L4

ewels commented 8 years ago

I take it back - they can go anywhere in the file. See https://github.com/github/linguist#using-emacs-or-vim-modelines

pditommaso commented 8 years ago

Cool! So in a comment like this:

/*
vim: syntax=groovy
-*- mode: groovy;-*-
*/
ewels commented 8 years ago

Exactly, yup 👍