Skip to content

Commit

Permalink
fix(formatters): add 1 to column numbers and line numbers
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/formatters/src/github-actions.ts
  • Loading branch information
siketyan committed Jul 25, 2023
1 parent b829876 commit 0b0c635
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/formatters/src/__tests__/github-actions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const results: IRuleResult[] = [
describe('GitHub Actions formatter', () => {
test('should be formatted correctly', () => {
expect(githubActions(results, { failSeverity: DiagnosticSeverity.Error }).split('\n')).toEqual([
'::warning title=operation-description,file=__tests__/fixtures/petstore.oas2.yaml,col=8,endColumn=60,line=60,endLine=71::paths./pets.get.description is not truthy',
'::warning title=operation-tags,file=__tests__/fixtures/petstore.oas2.yaml,col=8,endColumn=60,line=60,endLine=71::paths./pets.get.tags is not truthy',
'::warning title=operation-description,file=__tests__/fixtures/petstore.oas2.yaml,col=9,endColumn=61,line=61,endLine=72::paths./pets.get.description is not truthy',
'::warning title=operation-tags,file=__tests__/fixtures/petstore.oas2.yaml,col=9,endColumn=61,line=61,endLine=72::paths./pets.get.tags is not truthy',
]);
});
});
8 changes: 4 additions & 4 deletions packages/formatters/src/github-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export const githubActions: Formatter = results => {
const params: OutputParams = {
title: result.code.toString(),
file,
col: result.range.start.character,
endColumn: result.range.end.character,
line: result.range.start.line,
endLine: result.range.end.line,
col: result.range.start.character + 1,
endColumn: result.range.end.character + 1,
line: result.range.start.line + 1,
endLine: result.range.end.line + 1,
};

const paramsString = Object.entries(params)
Expand Down

0 comments on commit 0b0c635

Please sign in to comment.