Skip to content

Filter out files and folders to exclude#5

Open
iObject wants to merge 9 commits into
masterfrom
3-ability-to-exclude-certain-folders-or-libraries
Open

Filter out files and folders to exclude#5
iObject wants to merge 9 commits into
masterfrom
3-ability-to-exclude-certain-folders-or-libraries

Conversation

@iObject

@iObject iObject commented Aug 21, 2024

Copy link
Copy Markdown
Collaborator

No description provided.

@iObject iObject added the create-package create a temporary npm package on every commit label Aug 21, 2024
@iObject iObject requested a review from TwitchBronBron August 21, 2024 16:16
@iObject iObject linked an issue Aug 21, 2024 that may be closed by this pull request
@rokucommunity-bot

Copy link
Copy Markdown
Contributor

Hey there! I just built a new temporary npm package based on 6a5ad9d. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/bsc-plugin-auto-findnode/releases/download/v0.0.0-packages/bsc-plugin-auto-findnode-0.1.0-3-ability-to-exclude-certain-folders-or-libraries.20240821180237.tgz

Comment thread src/findNodes.ts Outdated
@rokucommunity-bot

Copy link
Copy Markdown
Contributor

Hey there! I just built a new temporary npm package based on 105b625. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/bsc-plugin-auto-findnode/releases/download/v0.0.0-packages/bsc-plugin-auto-findnode-0.1.0-3-ability-to-exclude-certain-folders-or-libraries.20240821180512.tgz

@iObject iObject requested a review from chrisdp August 21, 2024 21:59

@TwitchBronBron TwitchBronBron left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to tweak the path filtering a bit more. It should walk through the filters one-by-one.

Something like:

let fileIsExcluded = false;
for(const filter of filters){
    let isFIlterNegated = filter.startsWith('!');
    if(filter.isMatch(filePath)){
        fileIsExcluded = !isFilterNegated;
    }
}
//we've made it through every path, `fileIsExcluded` now accurately represents what should happen to this file.

Comment thread package.json
"undent": "^0.1.0"
},
"dependencies": {
"minimatch": "^10.0.1"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the same version that's in brighterscript, just for consistency's sake. I'm sure they work in a similar fashion.

https://github.com/rokucommunity/brighterscript/blob/2d0f46b26e003701f0b69fcc7e1f3db07fc615c0/package.json#L149

Comment thread src/findNodes.ts
return foundIDs;
}

function getFilteredScopes(program: Program) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This exclusion logic is not correct. Each pattern operates based on the results of the previous pattern. For example:

[
    //exclude all vendor scripts
    "source/vendor/**/*",
    //except don't exclude rodash
    "!source/vendor/rodash/**/*",
    //except DO exclude this specific rodash file
    "source/vendor/rodash/_all.bs"
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

create-package create a temporary npm package on every commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to exclude certain folders or libraries

2 participants