{"id":19945596,"url":"https://github.com/danger/peril-settings-linter","last_synced_at":"2025-10-06T13:43:17.058Z","repository":{"id":66079707,"uuid":"148955645","full_name":"danger/peril-settings-linter","owner":"danger","description":"A node module for listing the settings file ","archived":false,"fork":false,"pushed_at":"2019-03-31T19:13:47.000Z","size":79,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-07T18:42:04.059Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danger.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-16T02:15:17.000Z","updated_at":"2023-12-07T01:35:08.000Z","dependencies_parsed_at":"2023-04-01T11:51:37.082Z","dependency_job_id":null,"html_url":"https://github.com/danger/peril-settings-linter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danger%2Fperil-settings-linter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danger%2Fperil-settings-linter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danger%2Fperil-settings-linter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danger%2Fperil-settings-linter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danger","download_url":"https://codeload.github.com/danger/peril-settings-linter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252216096,"owners_count":21713098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T00:26:10.156Z","updated_at":"2025-10-06T13:43:12.002Z","avatar_url":"https://github.com/danger.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @peril/utils\n\nMaybe this will turn into a mono-repo with a lot of smaller packages, but for now - this is fine.\n\n### Generating a Peril Settings Repo\n\n```typescript\nexport const fileMapForPerilSettingsRepo = async (api: octokit, options: NewRepoOptions)\n```\n\nWhich returns a [fileMap](https://github.com/orta/memfs-or-file-map-to-github-branch) for an example Peril settings\nrepo. There are a few options.\n\nUsage:\n\n```ts\nconst map = await fileMapForPerilSettingsRepo(api, {\n  isPublic: true,\n  setupTests: true,\n  useTypeScript: true,\n  repo: {\n    name: \"Fake Repo\",\n    owner: {\n      login: \"User Name\",\n    },\n  },\n})\n```\n\n### Linting\n\nMainly one function:\n\n```typescript\nexport function lint(\n  settingsReference: string,\n  api: octokit,\n  currentSettings?: FileRelatedPartOfJSON\n): Promise\u003cErrorReport\u003e\n```\n\nYou pass in the dangerfile reference URL for the settings repo, an already set-up OctoKit `api` object (so you\nhandle auth basically) and you can optionally pass in the `currentSettings` - if you don't this lib will grab the\nversion in the `settingsReference`.\n\nUsage:\n\n```typescript\nimport { lint } from \"peril-settings-linter\"\n\nconst runLinter = async () =\u003e {\n  const results = await lint(\"artsy/peril-settings@settings.json\", api)\n  if (results.networkErrors.length) {\n    console.error(`Could not find files at: ${results.networkErrors.join(\",\")}`)\n  }\n\n  if (results.schemaErrors.length) {\n    console.error(`Settings file did not pass schema validation: ${results.schemaHumanReadableErrors}`)\n    console.error(`Settings file did not pass schema validation: ${results.schemaErrors}`)\n  }\n}\n```\n\n## How do I work on this?\n\n```sh\ngit clone https://github.com/orta/peril-settings-linter.git\ncd peril-settings-linter\nyarn install\n\n# Open VS Code with `code .`\ncode .\n\n# Run tests\nyarn jest\nyarn type-check\n```\n\n## How do I deploy this?\n\n```sh\nyarn release\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanger%2Fperil-settings-linter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanger%2Fperil-settings-linter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanger%2Fperil-settings-linter/lists"}