Skip to content

Commit

Permalink
Bugfix/issue 123 (#287)
Browse files Browse the repository at this point in the history
* Switch back to install because deps are pinned

* Ignore default files in sub-directories

* Remove trivial boolean

* Bump to v2 bc v1 is deprecated
  • Loading branch information
sebastianrath committed May 21, 2022
1 parent 4047a2f commit 9275b37
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand Down
41 changes: 20 additions & 21 deletions src/ignore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,27 @@ import * as fse from 'fs-extra';
const mm = require('micromatch');

const DEFAULT_IGNORE_PATTERNS = [
'thumbs.db',
'*.bkp',
'**/thumbs.db',
'**/*.bkp',
'bkp/**',
'*_bak[0-9]*.[A-Za-z0-9]+',
'*.tmp',
't?(e)mp/**',
'cache/**',
'*.lnk',
'[Dd]esktop.ini',

'Backup_of*', // Auto backup by Corel Draw
'Adobe Premiere Pro Auto-Save/**', // Adobe Premiere
'Adobe After Effects Auto-Save/**', // Adobe After Effects
'tmpAEtoAMEProject-*.aep', // Adobe After Effects <--> Media Encoder
'RECOVER_*', // Adobe Animate
'temp.noindex/**', // Adobe Character Animator
'~*', // Adobe InDesign lock files start with ~ and end with 'idlk'
'*.blend+([0-9])', // Blender auto-saved files
'*.bak*([0-9])', // Cinema 4D Backup files
'backup/**', // Cinema 4D auto-saved
'*.3dm.rhl', // Rhino tmp files
'*.3dmbak', // Rhino backup files
'**/*_bak[0-9]*.[A-Za-z0-9]+',
'**/*.tmp',
'**/t?(e)mp/**',
'**/*.lnk',
'**/[Dd]esktop.ini',

'**/Backup_of*', // Auto backup by Corel Draw
'**/Adobe Premiere Pro Auto-Save/**', // Adobe Premiere
'**/Adobe After Effects Auto-Save/**', // Adobe After Effects
'**/tmpAEtoAMEProject-*.aep', // Adobe After Effects <--> Media Encoder
'**/RECOVER_*', // Adobe Animate
'**/temp.noindex/**', // Adobe Character Animator
'**/~*', // Adobe InDesign lock files start with ~ and end with 'idlk'
'**/*.blend+([0-9])', // Blender auto-saved files
'**/*.bak*([0-9])', // Cinema 4D Backup files
'**/backup/**', // Cinema 4D auto-saved
'**/*.3dm.rhl', // Rhino tmp files
'**/*.3dmbak', // Rhino backup files
];
export class IgnoreManager {
patterns: string[] = [];
Expand Down
21 changes: 21 additions & 0 deletions test/8.ignore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,27 @@ test('Ignore Manager [foo/bar[1-4]]', (t) => {
testIgnore(t, pattern, ignored, unignored);
});

test.only('Ignore Manager test default ignore', (t) => {
const ignored = [
'test.blend1',
'foo/test.blend1',
'foo/test.blend2',
'foo/bar/test.blend1',
'foo/bar/test.blend2',
'foo/bar/bas/test.blend1',
'foo/bar/bas/test.blend2',
];

const unignored = [
'test.blend',
'foo/test.blend',
'foo/bar/test.blend',
'foo/bar/bas/test.blend',
];

testIgnore(t, [], ignored, unignored);
});

test('Ignore Test in getStatus: Ignore single file in root', async (t) => {
const repoPath = getRandomPath();
let repo: Repository;
Expand Down

0 comments on commit 9275b37

Please sign in to comment.