Open pik opened 7 years ago
Please feel free to put in a PR to either update existing definitions or add a note to this effect.
@pik Great analysis! By the way, in order for your ruby script to work from other directory, I'll recommend to change line 3 to: cd #{NANORC_STD_DIR}; ls
NANORC_GIT_DIR = "~/git/nanorc"
NANORC_STD_DIR = "/usr/share/nano"
standard_nanorcs = `cd #{NANORC_STD_DIR}; ls | xargs wc -l`.split("\n").map { |row| lcount, fname = row.lstrip.split(" "); [lcount.to_i, fname]}[0...-1]
standard_nanorcs.each do |lcount, fname|
`test -e #{NANORC_GIT_DIR}/#{fname}`
next unless $? == 0
lcount_new = `wc -l #{NANORC_GIT_DIR}/#{fname}`.split(" ").first.to_i
if lcount > lcount_new
puts "Standard syntax definition is more verbose for: #{fname}... #{lcount} vs #{lcount_new}"
end
end
Here is a quick comparison by line number:
While sometimes the verbose definition might not be superior - it clearly is in a number of cases. For example here is the
po.nanorc
from the upstream repo:vs. the one provided by this repo:
I'd recommend remove syntax definitions which already exist upstream, or to add a note in the README regarding the ones which may be out-dated.