Skip to content

Commit

Permalink
fix: sync updates from upstream repolinter
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeveland27 committed Feb 17, 2023
1 parent e2b1479 commit d779d1b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions __tests__/getConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('getConfig', () => {

test('getConfig returns a config from a YAML', async () => {
const filepath = path.resolve(__dirname, 'testconfig.yaml')
const expected = yaml.safeLoad(
const expected = yaml.load(
await fs.promises.readFile(filepath, 'utf8')
) as Record<string, unknown>
const res = await getConfig({configFile: filepath})
Expand Down Expand Up @@ -53,7 +53,7 @@ describe('getConfig', () => {
const url =
'https://raw.githubusercontent.com/aperture-science-incorporated/.github/master/repolinter.yaml'
const filepath = path.resolve(__dirname, 'testconfig.yaml')
const expected = yaml.safeLoad(
const expected = yaml.load(
await fs.promises.readFile(filepath, 'utf8')
) as Record<string, unknown>
const scope = nock('https://raw.githubusercontent.com')
Expand Down
3 changes: 1 addition & 2 deletions src/createorUpdateIssue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,7 @@ export interface UpdateReplolinterIssueOpts {
* @param options.owner The owner of the repository to update the issue on
* @param options.repo The name of the repository to update the issue on
* @param options.issueNumber The issue number to update (ex. #2, different from the ID)
* @param options.issueContent The body to update the issue with, formatted as
* markdown.
* @param options.issueContent The body to update the issue with, formatted as markdown.
* @param options.shouldClose Set this to true to close the issue, otherwise the issue
* @param options.runNumber The current GITHUB_RUN_NUMBER, which will be
* inserted at the bottom of the issue.
Expand Down
10 changes: 5 additions & 5 deletions src/getConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {validateConfig} from 'repolinter'
* validated deserialized configuration.
*
* @param where.configFile The file path to the config, relative to the current
* working directory. Mutually exclusive with where.configUrl.
* working directory. Mutually exclusive with where.configUrl.
* @param where.configUrl The URL to load fhe config from. Mutually exclusive
* with where.configFile
* with where.configFile
* @returns A deserialized JSON or YAML configuration object if one was found.
* If the configuration does not exist or does not pass validation this
* function will throw an error.
* If the configuration does not exist or does not pass validation this
* function will throw an error.
*/
export default async function getConfig(where: {
configFile?: string
Expand Down Expand Up @@ -65,7 +65,7 @@ export default async function getConfig(where: {
}
if (!ret) {
try {
ret = yaml.safeLoad(contents)
ret = yaml.load(contents, {schema: yaml.JSON_SCHEMA})
} catch (e) {
yamlError = e
}
Expand Down

0 comments on commit d779d1b

Please sign in to comment.