Skip to content

Commit

Permalink
Merge pull request #14 from stscoundrel/feature/common-vendors
Browse files Browse the repository at this point in the history
Feature/common vendors
  • Loading branch information
stscoundrel authored Jan 29, 2022
2 parents 1b85d8e + dd26bb8 commit be7f1ac
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ignores/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
const DEFAULT_IGNORES = [
'.git',
'.github',
];

const VENDOR_IGNORES = [
'node_modules',
'bower_components',
'vendor',
];

export const getDefaultIgnores = (): string[] => DEFAULT_IGNORES;
const IGNORES = [...DEFAULT_IGNORES, ...VENDOR_IGNORES];

export const getDefaultIgnores = (): string[] => IGNORES;

export const doesNotContainIgnores = (
path: string,
Expand Down
5 changes: 5 additions & 0 deletions tests/fixtures/index.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// For Balder the mead, a drink for the noble
// I was forced to speak, now silence is my name

// Hod shall guide him, shall be his bane
// I was forced to speak, now silence is my name
5 changes: 5 additions & 0 deletions tests/fixtures/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// For Balder the mead, a drink for the noble
// I was forced to speak, now silence is my name

// Hod shall guide him, shall be his bane
// I was forced to speak, now silence is my name
5 changes: 5 additions & 0 deletions tests/fixtures/index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# For Balder the mead, a drink for the noble
# I was forced to speak, now silence is my name

# Hod shall guide him, shall be his bane
# I was forced to speak, now silence is my name
5 changes: 5 additions & 0 deletions tests/fixtures/index.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// For Balder the mead, a drink for the noble
// I was forced to speak, now silence is my name

// Hod shall guide him, shall be his bane
// I was forced to speak, now silence is my name
5 changes: 5 additions & 0 deletions tests/fixtures/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// For Balder the mead, a drink for the noble
// I was forced to speak, now silence is my name

// Hod shall guide him, shall be his bane
// I was forced to speak, now silence is my name
5 changes: 5 additions & 0 deletions tests/fixtures/subfolder1/submodule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// For Balder the mead, a drink for the noble
// I was forced to speak, now silence is my name

// Hod shall guide him, shall be his bane
// I was forced to speak, now silence is my name
5 changes: 5 additions & 0 deletions tests/fixtures/subfolder1/submodule2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// For Balder the mead, a drink for the noble
// I was forced to speak, now silence is my name

// Hod shall guide him, shall be his bane
// I was forced to speak, now silence is my name
5 changes: 5 additions & 0 deletions tests/fixtures/subfolder2/subfolder2-3/submodule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// For Balder the mead, a drink for the noble
// I was forced to speak, now silence is my name

// Hod shall guide him, shall be his bane
// I was forced to speak, now silence is my name
5 changes: 5 additions & 0 deletions tests/fixtures/subfolder2/submodule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// For Balder the mead, a drink for the noble
// I was forced to speak, now silence is my name

// Hod shall guide him, shall be his bane
// I was forced to speak, now silence is my name
5 changes: 5 additions & 0 deletions tests/fixtures/vendors/bower_components/bower.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// For Balder the mead, a drink for the noble
// I was forced to speak, now silence is my name

// Hod shall guide him, shall be his bane
// I was forced to speak, now silence is my name
5 changes: 5 additions & 0 deletions tests/fixtures/vendors/node_modules/npm.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
5 changes: 5 additions & 0 deletions tests/fixtures/vendors/vendor/vendor.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// For Balder the mead, a drink for the noble
// I was forced to speak, now silence is my name

// Hod shall guide him, shall be his bane
// I was forced to speak, now silence is my name
7 changes: 7 additions & 0 deletions tests/unit/ignores.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ describe('Alliser ignore tests', () => {
result.forEach((filePath) => expect(filePath.includes('.git')).toBeFalsy());
result.forEach((filePath) => expect(filePath.includes('.github')).toBeFalsy());
});

test('Does not scan common vendor folders', () => {
const result = alliser.check(['.ts'], ['./tests/fixtures/vendors']);

// We expect no files to be found here, as its all vendor folders.
expect(result.length).toBe(0);
});
});

0 comments on commit be7f1ac

Please sign in to comment.