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

Switch to scope activationHook from language package #124

Merged
merged 6 commits into from
Feb 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/linter-reek.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ export default {
provideLinter() {
return {
name: 'reek',
grammarScopes: ['source.ruby', 'source.ruby.rails', 'source.ruby.rspec'],
grammarScopes: [
'source.ruby',
'source.ruby.rails',
'source.ruby.rspec',
],
scope: 'file',
lintsOnChange: false,
lint: async (editor) => {
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"default": "reek"
}
},
"activationHooks": [
"source.ruby:root-scope-used",
"source.ruby.rails:root-scope-used",
"source.ruby.rspec:root-scope-used"
],
"engines": {
"atom": ">=1.7.0 <2.0.0"
},
Expand Down
16 changes: 15 additions & 1 deletion spec/linter-reek-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,22 @@ const badFile = path.join(__dirname, 'fixtures', 'bad.rb');
describe('The reek provider for Linter', () => {
beforeEach(async () => {
atom.workspace.destroyActivePaneItem();

const activationPromise = atom.packages.activatePackage('linter-reek');

await atom.packages.activatePackage('language-ruby');
await atom.packages.activatePackage('linter-reek');
await atom.workspace.open(goodFile);

atom.packages.triggerDeferredActivationHooks();
await activationPromise;
});

it('should be in the packages list', () => {
expect(atom.packages.isPackageLoaded('linter-reek')).toBe(true);
});

it('should be an active package', () => {
expect(atom.packages.isPackageActive('linter-reek')).toBe(true);
});

it('checks a file with issues and reports the correct message', async () => {
Expand Down