Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Conversation

@Arcanemagus
Copy link
Member

Many small upgrades and cleanup to the code, generally bringing it in line with other current linter providers including:

  • Utilizing ES2017 features
  • Move to a configSchema
  • Observing settings instead of geting them on every lint call

Also fixes a few bugs:

  • Guard against a potential race condition where the file is edited after a lint was triggered, but before the results are returned, leading to the possibility of the positions returned being no longer correct, thus triggering a false positive on the invalid point check.
  • Fix the encoding specification, for some reason some platforms don't like -E utf-8, treating the encoding from that as utf-8 (with a space on the front. As the documentation doesn't show a space before the option, simply remove it to make this work on all platforms.
  • Allow no output: On files with no issues there is no output, which would cause an error as of the upgrade to atom-linter@8.

Move hte configuration to a key in the `package.json`, allowing Atom to be
able to read the settings without having to load up the package code.
This removes any chance of ambiguity and has the potential to speed up
activation a few ms.
Move to the `import` syntax for bringing in the dependencies. Note that
since Atom calls the service provider function on package activation this
doesn't make a big difference on performance.
Use the much cleaner async/await syntax to clean up the code around the
execution of `ruby`.
Instead of making Atom lookup the settings on each lint call, observe them
in the activation so this work isn't needlessly repeated.
Rename the variable to match every other linter provider.
Let the regex do it's job of text processing and don't feed it only parts
of the output.
If the file changes between when the lint was triggered and the start of
output processing simply tell Linter to not update the messages instead of
attempting to mark a document in a different state from when the output
was generated.
With the space in there some platforms treat the encoding as ` utf-8`
instead of the desired `utf-8`. Since the `ruby` help text shows no space
in there in the first place, this is more correct and works on platforms
where it was broken before.
On files that have no issues, `ruby -wc` gives no output.
@Arcanemagus Arcanemagus merged commit 148a2be into master Dec 1, 2016
@Arcanemagus Arcanemagus deleted the arcanemagus/cleanup branch December 1, 2016 19:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants