You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With all the recent news about Hacktoberfest I thought it would be a good idea to point out good beginner issues that would be actually helpful for bat. In the past years, I have actually experienced Hacktoberfest as a really great event - both as a contributor as well as a maintainer.
As of recently, bat has a set of syntax highlighting regression tests (see #1124 for more details). The main idea is that we have a large collection of test files for each and every language that bat can highlight. This way, we can make sure that we do not run into issues we had in the past where either (1) syntax highlighting for some language is suddenly not working anymore or (2) bat suddenly crashes/panics for some input (due to incompatibilities in the regex flavors in syntect and Sublime Text).
In order to add a new test file, you can follow these steps (let's take "Ruby" as an example):
Make sure that you are running the latest version of bat (master or bat 0.16) and that bat is available on the path.
Find an example Ruby source file or write one yourself. If possible, the file should aim to be "comprehensive" (i.e. include a lot of the possible syntax), but this is not strictly necessary. A simple file is better than none at all. Also, the files shouldn't be gigantic.
Save the file in tests/syntax-tests/source/Ruby (adapt for your language). The file name could be test.rb (adapt extension) but can also be adapted if that is necessary in order for bat to highlight it correctly (e.g. Makefile).
If you have copied the file from somewhere else, please make sure that the file may be copied under the respective license and that the license is compatible with bats license. If it requires attribution, please add a LICENSE.md in the same folder with a text like this:
The `test.rb` file has been added from [enter source here] under the following license:
[add license text here]
Go to tests/syntax-tests and run the update.sh Bash script. A new file should be generated in the highlighted folder (e.g. highlighted/Ruby/test.rb).
Use cat or bat --language=txt to display the content of this file and make sure that the syntax highlighting looks correct.
git add the new files in the source folder as well as the autogenerated files in the highlighted folder.
It would be great if we could focus on the syntaxes in sublimehq/Packages first (marked in bold) as this would allow us to merge #1174 without having to worry (too much) about syntax highlighting regressions. Also, most of these are really popular languages, so it makes sense to have them in the test suite.
With all the recent news about Hacktoberfest I thought it would be a good idea to point out good beginner issues that would be actually helpful for
bat. In the past years, I have actually experienced Hacktoberfest as a really great event - both as a contributor as well as a maintainer.As of recently,
bathas a set of syntax highlighting regression tests (see #1124 for more details). The main idea is that we have a large collection of test files for each and every language thatbatcan highlight. This way, we can make sure that we do not run into issues we had in the past where either (1) syntax highlighting for some language is suddenly not working anymore or (2)batsuddenly crashes/panics for some input (due to incompatibilities in theregexflavors insyntectand Sublime Text).In order to add a new test file, you can follow these steps (let's take "Ruby" as an example):
bat(masterorbat0.16) and thatbatis available on the path.tests/syntax-tests/source/Ruby(adapt for your language). The file name could betest.rb(adapt extension) but can also be adapted if that is necessary in order forbatto highlight it correctly (e.g.Makefile).bats license. If it requires attribution, please add aLICENSE.mdin the same folder with a text like this:tests/syntax-testsand run theupdate.shBash script. A new file should be generated in thehighlightedfolder (e.g.highlighted/Ruby/test.rb).catorbat --language=txtto display the content of this file and make sure that the syntax highlighting looks correct.git addthe new files in thesourcefolder as well as the autogenerated files in thehighlightedfolder.List of languages / syntaxes:
/proc/cpuinfo)/etc/group--show-all)/etc/hosts/proc/meminfo)/etc/passwdrequirements.txt/etc/resolv.conf)It would be great if we could focus on the syntaxes in
sublimehq/Packagesfirst (marked in bold) as this would allow us to merge #1174 without having to worry (too much) about syntax highlighting regressions. Also, most of these are really popular languages, so it makes sense to have them in the test suite.