New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: is not a valid owner name in rule * @username #19
Comments
Clear. Somehow the dependency I'm using doesn't like the CODEOWNERS file or syntax. Can take a closer look tomorrow. |
Sounds good. Thank you for the quick response |
The
Knip should prevent globs starting with |
Maybe it's a Windows incompatibility with the other package, such as here: https://github.com/snyk/github-codeowners/blob/main/src/lib/ownership/OwnershipEngine.ts#L44 Could you try to make your |
Okay, so after a good amount of debugging, I've arrived at this point: npx knip --reporter json --include files,duplicates and pnpm knip --reporter json --include files,duplicates both produce the same output of: Steps taken to arrive at this point:
So, I do not have any errors 🙌 but I also do not have the full output that you referenced in this comment. What are your thoughts? |
Alright, getting there :) Does it work as expected if you use the default reporter? What does this debug output give?
You can additionally add |
Here you go :) Looks like it marks all dependencies as unused, which is what happened when I first used the tool yesterday (before adding the C:\coding-work\halo-discord\halo-discord-bot>npx knip --debug
[knip] Unresolved configuration:
{
cwd: 'C:\\coding-work\\halo-discord\\halo-discord-bot',
workingDir: 'C:\\coding-work\\halo-discord\\halo-discord-bot',
configFilePath: undefined,
tsConfigFilePath: undefined,
include: [],
exclude: [],
ignore: [],
gitignore: true,
isIncludeEntryFiles: false,
isDev: false,
isShowProgress: false,
jsDoc: [],
debug: { isEnabled: true, level: 1 }
}
[knip] Resolved configuration:
{ dev: true, entryFiles: [ 'index.js' ], projectFiles: [ '**/*.js' ] }
[knip] Globbed entry paths (1)
[knip] Included entry source files (1)
[knip] Included production source files (343)
[knip] Globbed project paths (0)
[knip] Included project source files (0)
[knip] Used production files (0)
[knip] Unreferenced production files (0)
[knip] Used entry files (0)
[knip] Used non-entry files (0)
--- UNUSED FILES (0)
Not found
--- UNUSED DEPENDENCIES (14)
bidirectional-map
chalk
discord.js
dotenv
firebase-admin
klaw
knip
lodash-es
moment
node-schedule
serialize-error
set-interval-async
superagent
typescript
--- UNUSED DEV DEPENDENCIES (1)
express
--- UNLISTED DEPENDENCIES (0)
Not found
--- UNUSED EXPORTS (0)
Not found
--- UNUSED TYPES (0)
Not found
--- UNUSED EXPORTS IN NAMESPACE (0)
Not found
--- UNUSED TYPES IN NAMESPACE (0)
Not found
--- DUPLICATE EXPORTS (0)
Not found Long `npx knip --debug --debug-level 2` output
|
Thanks for the output, that was very useful. It led me to find that some path handling (OS specific) was mixed with globbing (always using By the way, I've also decided to always add So I'd be happy to hear whether v0.10.0 works better :) |
v10 is looking much better! Here's my output for --- UNUSED FILES (15)
C:/coding-work/halo-discord/halo-discord-bot/api/controllers/GatewayController.js
C:/coding-work/halo-discord/halo-discord-bot/api/controllers/index.js
C:/coding-work/halo-discord/halo-discord-bot/api/index.js
C:/coding-work/halo-discord/halo-discord-bot/api/routes/gateway.js
C:/coding-work/halo-discord/halo-discord-bot/api/routes/index.js
C:/coding-work/halo-discord/halo-discord-bot/api/routes/refresh-token.js
C:/coding-work/halo-discord/halo-discord-bot/api/routes/token-validate.js
C:/coding-work/halo-discord/halo-discord-bot/commands/admin/distributetos.js
C:/coding-work/halo-discord/halo-discord-bot/commands/development/test.js
C:/coding-work/halo-discord/halo-discord-bot/commands/general/ping.js
C:/coding-work/halo-discord/halo-discord-bot/commands/halo/setup.js
C:/coding-work/halo-discord/halo-discord-bot/events/cron/updateClassStageAndUserStatus.js
C:/coding-work/halo-discord/halo-discord-bot/events/discord/interactionCreate/contextMenu.js
C:/coding-work/halo-discord/halo-discord-bot/events/discord/interactionCreate/slashCommand.js
C:/coding-work/halo-discord/halo-discord-bot/events/firebase/userCreate.js
--- UNUSED DEPENDENCIES (1)
typescript
--- UNUSED DEV DEPENDENCIES (2)
express
knip
--- UNLISTED DEPENDENCIES (0)
Not found
--- UNUSED EXPORTS (0)
Not found
--- UNUSED TYPES (0)
Not found
--- UNUSED EXPORTS IN NAMESPACE (3)
getUserSettings classes\services\FirebaseService.js
getActiveUsersInClassAsync classes\services\FirebaseService.js
getActiveDiscordUsersInClass classes\services\FirebaseService.js
--- UNUSED TYPES IN NAMESPACE (0)
Not found
--- DUPLICATE EXPORTS (0)
Not found However, when I run [{"file":"api\\index.js","owners":["@elijaholmos"],"files":true,"unlisted":[],"exports":[],"types":[],"duplicates":[]},{"file":"api\\controllers\\GatewayController.js","owners":["@elijaholmos"],"files":true,"unlisted":[],"exports":[],"types":[],"duplicates":[]},{"file":"api\\controllers\\index.js","owners":["@elijaholmos"],"files":true,"unlisted":[],"exports":[],"types":[],"duplicates":[]},{"file":"api\\routes\\gateway.js","owners":["@elijaholmos"],"files":true,"unlisted":[],"exports":[],"types":[],"duplicates":[]},{"file":"api\\routes\\index.js","owners":["@elijaholmos"],"files":true,"unlisted":[],"exports":[],"types":[],"duplicates":[]},{"file":"api\\routes\\refresh-token.js","owners":["@elijaholmos"],"files":true,"unlisted":[],"exports":[],"types":[],"duplicates":[]},{"file":"api\\routes\\token-validate.js","owners":["@elijaholmos"],"files":true,"unlisted":[],"exports":[],"types":[],"duplicates":[]},{"file":"commands\\admin\\distributetos.js","owners":["@elijaholmos"],"files":true,"unlisted":[],"exports":[],"types":[],"duplicates":[]},{"file":"commands\\development\\test.js","owners":["@elijaholmos"],"files":true,"unlisted":[],"exports":[],"types":[],"duplicates":[]},{"file":"commands\\general\\ping.js","owners":["@elijaholmos"],"files":true,"unlisted":[],"exports":[],"types":[],"duplicates":[]},{"file":"commands\\halo\\setup.js","owners":["@elijaholmos"],"files":true,"unlisted":[],"exports":[],"types":[],"duplicates":[]},{"file":"events\\cron\\updateClassStageAndUserStatus.js","owners":["@elijaholmos"],"files":true,"unlisted":[],"exports":[],"types":[],"duplicates":[]},{"file":"events\\firebase\\userCreate.js","owners":["@elijaholmos"],"files":true,"unlisted":[],"exports":[],"types":[],"duplicates":[]},{"file":"events\\discord\\interactionCreate\\contextMenu.js","owners":["@elijaholmos"],"files":true,"unlisted":[],"exports":[],"types":[],"duplicates":[]},{"file":"events\\discord\\interactionCreate\\slashCommand.js","owners":["@elijaholmos"],"files":true,"unlisted":[],"exports":[],"types":[],"duplicates":[]},{"file":"classes\\services\\FirebaseService.js","owners":["@elijaholmos"],"files":false,"unlisted":[],"exports":["getActiveDiscordUsersInClass","getActiveUsersInClassAsync","getUserSettings"],"types":[],"duplicates":[]}] It looks like the JSON report is missing the unused dependencies and unused dev dependencies that were included in the |
Yeah this is as implemented. The JSON report is grouped by file, but now that I write this Knip could just assign these issues to the package.json file. Still early days, thanks for bearing with me and helping push this project forward! |
absolutely! thank you for hearing my feedback and working with me |
The (dev) |
sounds good, thank you. I'll open new issues for any other problems |
following up: https://github.com/snyk/github-codeowners now supports CRLF in CODEOWNERS files as of 1.1.0 |
Thanks! v0.13.3 |
Hello,
I was playing around with the CLI in my local project, and I got an error when running it in the following context:
command:
output:
knip.json
:The project I'm testing knip in is open-source and can be found at https://github.com/elijaholmos/halo-discord-bot. In my CODEOWNERS file, I'm using the global owners syntax, as specified here.
The text was updated successfully, but these errors were encountered: