Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to integrate spellr with gitlab ci #74

Open
khalilgharbaoui opened this issue Mar 22, 2021 · 1 comment
Open

How to integrate spellr with gitlab ci #74

khalilgharbaoui opened this issue Mar 22, 2021 · 1 comment

Comments

@khalilgharbaoui
Copy link

I have been using pronto and pronto-spell in gitlab ci pipelines for spell checks/comments.

But I would very much like to use spellr instead. (or a pronto-spellr)

Point 8 says:
It's easy to integrate with CI pipelines.

Are there some undocumented instructions of sorts somewhere for this?

Or is this only gonna be possible after the STDIN functionality has been added?

Also, how would one go about adding a custom output formatted?

Cheers,
Khalil

@robotdana
Copy link
Owner

robotdana commented Jun 12, 2021

hi sorry i didn't see this as i was treating issues as notes to myself. i shouldn't do that.

by easy to set up on ci i mean i've never had difficulty getting it running on ci :D (maybe that's an unfair point)

i've run it in travis, GitHub actions, and buildkite.

example travis code:
https://github.com/robotdana/spellr/blob/d549918e4cf20fe095359b627d0f6f8292d0d24d/.travis.yml
and this Rakefile
https://github.com/robotdana/spellr/blob/d549918e4cf20fe095359b627d0f6f8292d0d24d/Rakefile.yml

for GitHub actions, refer to:
https://github.com/robotdana/spellr/blob/main/.github/workflows/ci.yml

it should be happy running on anything that already has either ruby, or docker set up.

--

in terms of custom output format, i don't have a particular system in mind. it could be interesting to develop a custom reporter. i'm not sure spellr is at the point where that would be a public documented interface, but if you want you could make a pr.

if you want to look at the various systems that can be swapped in as reporters then please do:
https://github.com/robotdana/spellr/blob/main/lib/spellr/reporter.rb
https://github.com/robotdana/spellr/blob/main/lib/spellr/base_reporter.rb
https://github.com/robotdana/spellr/blob/main/lib/spellr/wordlist_reporter.rb
https://github.com/robotdana/spellr/blob/main/lib/spellr/quiet_reporter.rb
https://github.com/robotdana/spellr/blob/main/lib/spellr/interactive.rb

the basic interface for these is 3 methods:
initialise(output = nil)
output holds the stdin/stdout/stderr and a counts hash, and the exit code lib/spellr/base_reporter.rb
call(token)
token is a string with a filename and location. this is generally used to print each error.
finish
finish is called when everything is complete and is generally used to print the counts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants