Title: ParserError exception raised for invalid configuration · Issue #2685 · pre-commit/pre-commit · GitHub
Open Graph Title: ParserError exception raised for invalid configuration · Issue #2685 · pre-commit/pre-commit
X Title: ParserError exception raised for invalid configuration · Issue #2685 · pre-commit/pre-commit
Description: search you tried in the issue tracker ParserError and unicode describe your issue I executed pre-commit autoupdate with an invalid configuration file (the second - repo is indented incorrectly) and got this error message: $ pre-commit au...
Open Graph Description: search you tried in the issue tracker ParserError and unicode describe your issue I executed pre-commit autoupdate with an invalid configuration file (the second - repo is indented incorrectly) and...
X Description: search you tried in the issue tracker ParserError and unicode describe your issue I executed pre-commit autoupdate with an invalid configuration file (the second - repo is indented incorrectly) and...
Opengraph URL: https://github.com/pre-commit/pre-commit/issues/2685
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ParserError exception raised for invalid configuration","articleBody":"### search you tried in the issue tracker\r\n\r\nParserError and unicode\r\n\r\n### describe your issue\r\n\r\nI executed `pre-commit autoupdate` with an invalid configuration file (the second `- repo` is indented incorrectly) and got this error message:\r\n\r\n````\r\n$ pre-commit autoupdate\r\nAn unexpected error has occurred: ParserError: while parsing a block mapping\r\n in \"\u003cunicode string\u003e\", line 1, column 1\r\ndid not find expected key\r\n in \"\u003cunicode string\u003e\", line 7, column 1\r\nCheck the log at /home/carsten/.cache/pre-commit/pre-commit.log\r\n````\r\n\r\nThis is an expected error and I would expect an error message like `Your configuration file \"...\" is wrongly formatted at \u003cpos\u003e. Please review the format of the content.'.\r\n\r\nThank you,\r\nCarsten\r\n\r\n### pre-commit --version\r\n\r\npre-commit 2.21.0\r\n\r\n### .pre-commit-config.yaml\r\n\r\n```yaml\r\nrepos:\r\n - repo: https://github.com/pre-commit/pre-commit-hooks\r\n rev: v4.4.0\r\n hooks:\r\n - id: check-executables-have-shebangs\r\n\r\n- repo: https://github.com/shellcheck-py/shellcheck-py\r\n rev: v0.9.0.2\r\n hooks:\r\n - id: shellcheck\r\n```\r\n\r\n\r\n### ~/.cache/pre-commit/pre-commit.log (if present)\r\n\r\n### version information\r\n\r\n```\r\npre-commit version: 2.21.0\r\ngit --version: git version 2.35.3\r\nsys.version:\r\n 3.10.8 (main, Oct 28 2022, 17:28:32) [GCC]\r\nsys.executable: /home/carsten/virtualenv/bin/python3.10\r\nos.name: posix\r\nsys.platform: linux\r\n```\r\n\r\n### error information\r\n\r\n```\r\nAn unexpected error has occurred: ParserError: while parsing a block mapping\r\n in \"\u003cunicode string\u003e\", line 1, column 1\r\ndid not find expected key\r\n in \"\u003cunicode string\u003e\", line 7, column 1\r\n```\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/home/carsten/virtualenv/lib64/python3.10/site-packages/pre_commit/error_handler.py\", line 73, in error_handler\r\n yield\r\n File \"/home/carsten/virtualenv/lib64/python3.10/site-packages/pre_commit/main.py\", line 355, in main\r\n return autoupdate(\r\n File \"/home/carsten/virtualenv/lib64/python3.10/site-packages/pre_commit/commands/autoupdate.py\", line 154, in autoupdate\r\n migrate_config(config_file, quiet=True)\r\n File \"/home/carsten/virtualenv/lib64/python3.10/site-packages/pre_commit/commands/migrate_config.py\", line 47, in migrate_config\r\n contents = _migrate_map(contents)\r\n File \"/home/carsten/virtualenv/lib64/python3.10/site-packages/pre_commit/commands/migrate_config.py\", line 16, in _migrate_map\r\n if isinstance(yaml_load(contents), list):\r\n File \"/home/carsten/virtualenv/lib64/python3.10/site-packages/yaml/__init__.py\", line 81, in load\r\n return loader.get_single_data()\r\n File \"/home/carsten/virtualenv/lib64/python3.10/site-packages/yaml/constructor.py\", line 49, in get_single_data\r\n node = self.get_single_node()\r\n File \"yaml/_yaml.pyx\", line 673, in yaml._yaml.CParser.get_single_node\r\n File \"yaml/_yaml.pyx\", line 687, in yaml._yaml.CParser._compose_document\r\n File \"yaml/_yaml.pyx\", line 731, in yaml._yaml.CParser._compose_node\r\n File \"yaml/_yaml.pyx\", line 847, in yaml._yaml.CParser._compose_mapping_node\r\n File \"yaml/_yaml.pyx\", line 860, in yaml._yaml.CParser._parse_next_event\r\nyaml.parser.ParserError: while parsing a block mapping\r\n in \"\u003cunicode string\u003e\", line 1, column 1\r\ndid not find expected key\r\n in \"\u003cunicode string\u003e\", line 7, column 1\r\n```","author":{"url":"https://github.com/CarstenGrohmann","@type":"Person","name":"CarstenGrohmann"},"datePublished":"2023-01-09T10:57:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2685/pre-commit/issues/2685"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:82c6ead3-db00-810f-ad61-aea285b490e7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D966:3C94F8:331B38E:4627DD1:6A57056C |
| html-safe-nonce | 66937571c49d12eb0b0e2c1413832298ead06a2da2b0b01305e3ed267e14f038 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTY2OjNDOTRGODozMzFCMzhFOjQ2MjdERDE6NkE1NzA1NkMiLCJ2aXNpdG9yX2lkIjoiMzE1NzEzNzMyOTAwMjg0MTQ1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c35fabb671f04abc431d1aed128365f9fbc589c3b65dceef90ef0d5cf66289e4 |
| hovercard-subject-tag | issue:1525349103 |
| github-keyboard-shortcuts | repository,issues,commits,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pre-commit/pre-commit/2685/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b8f22f03ff3dc793859667b344f19ad683329c0aedfe2581beca0725b53ffdf1/pre-commit/pre-commit/issues/2685 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b8f22f03ff3dc793859667b344f19ad683329c0aedfe2581beca0725b53ffdf1/pre-commit/pre-commit/issues/2685 |
| og:image:alt | search you tried in the issue tracker ParserError and unicode describe your issue I executed pre-commit autoupdate with an invalid configuration file (the second - repo is indented incorrectly) and... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | CarstenGrohmann |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb29e5f807bd95e41196adfbc6d28f9af12d89830d8b684f3e871774ddff2fc |
| turbo-cache-control | no-preview |
| go-import | github.com/pre-commit/pre-commit git https://github.com/pre-commit/pre-commit.git |
| octolytics-dimension-user_id | 6943086 |
| octolytics-dimension-user_login | pre-commit |
| octolytics-dimension-repository_id | 17689377 |
| octolytics-dimension-repository_nwo | pre-commit/pre-commit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 17689377 |
| octolytics-dimension-repository_network_root_nwo | pre-commit/pre-commit |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b056788a129fb0194b61f2ebb4c43f6a9f4dfd27 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width