GithubHelp home page GithubHelp logo

Comments (7)

tractorcow avatar tractorcow commented on June 12, 2024

Another check in the same repo (eslint: true) passes successfully, so it's not a permission issue. It's only an issue for prettier: true check

Create check runs with commit annotations
  Creating GitHub check with success conclusion and 0 annotations for ESLint…
  ESLint check created successfully

from lint-action.

tractorcow avatar tractorcow commented on June 12, 2024

How can I get the payload for the HTTP post to debug?

from lint-action.

tractorcow avatar tractorcow commented on June 12, 2024

I managed to extract the payload that was causing the 422 error. The issue is "path" is a required field, but not included.

{
   "name":"Prettier",
   "head_sha":"8926cd754ef3fc50cf4f605b55fa686f4da2630c",
   "conclusion":"failure",
   "output":{
      "title":"1 error",
      "summary":"Prettier found 1 error",
      "annotations":[
         {
            "path":"",
            "start_line":1,
            "end_line":1,
            "annotation_level":"failure",
            "message":"There are issues with this file's formatting, please run Prettier to fix the errors"
         }
      ]
   }
}

from lint-action.

tractorcow avatar tractorcow commented on June 12, 2024

I've tracked the issue to prettier itself; prettier/prettier#13516

I think this module could respond a bit better to prettier erroring. In linters/prettier.js we have this code.

		const paths = output.stdout.split(/\r?\n/);
		lintResult.error = paths.map((path) => ({
			path,
			firstLine: 1,
			lastLine: 1,
			message:
				"There are issues with this file's formatting, please run Prettier to fix the errors",
		}));

However in this case, output.stdout is blank (hence path being an empty string), with the error being in output.stderr.

from lint-action.

tractorcow avatar tractorcow commented on June 12, 2024

Updating prettier in my project seemed to solve the issue. I'll close this, sorry for the noise!

from lint-action.

tractorcow avatar tractorcow commented on June 12, 2024

I've suggested a minor improvement at #722 to prevent invalid checks being pushed.

from lint-action.

tractorcow avatar tractorcow commented on June 12, 2024

Checking output.stderror this is that value. Should I bother to parse this?

[error] src/components/Icon/Icon.stories.tsx: SyntaxError: ',' expected. (32:3)
[error]   30 |     },
[error]   31 |   },
[error] > 32 | } satisfies Meta<typeof Icon>
[error]      |   ^
[error]   33 |
[error]   34 | export default meta
[error]   35 | type Story = StoryObj<typeof Icon>

I could regexp the first line and extract path, error, line, character?

from lint-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.