-
Notifications
You must be signed in to change notification settings - Fork 45
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
scrape.js: Search org for user #75
Conversation
lib/scrape.js
Outdated
@@ -4,6 +4,7 @@ const fs = require('fs') | |||
const json2yaml = require('json2yaml') | |||
|
|||
const GH_USER_BASE = 'https://github.com/users' | |||
const GH_ORG_BASE = 'https://github.com/orgs' // Ignore InvalidLinkBear |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just add github.com to the ignore list in .coafile
lib/scrape.js
Outdated
@@ -155,14 +167,17 @@ async function findOrganization({ | |||
async function findGitHubUser({ display_name }, org) { | |||
if (!org) return | |||
|
|||
display_name = display_name.replace(/ /g, '') | |||
const shortName = display_name.replace(/ /g, '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spaces are not valid in github usernames, so this is a very basic "convert to valid username". There was a npm package which checked legality of a name. What we want is a smarter "convert name into most similar valid github probable username". maybe a npm package already exists; if not, ... create one ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh man, alright, I'm running out of package naming ideas ;)
f2c3068
to
4ecec91
Compare
This searches the user's organization for their display name. If the user is found, their username will be linked. Closes coala#8
4ecec91
to
f2934af
Compare
@@ -14,6 +14,7 @@ bears = LineLengthBear | |||
|
|||
[all.links] | |||
bears = InvalidLinkBear | |||
link_ignore_regex = (github\.com|\{|\$) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's link_ignore_list
that uses globbing instead
link_ignore_list = https://github.com/**
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ Optional.
ack f2934af |
1 similar comment
ack f2934af |
This searches the user's organization for their display name. If
the user is found, their username will be used.
Closes #8