Skip to content

Commit

Permalink
chore(lint): Fix code style with lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yamadashy committed Oct 16, 2024
1 parent 17bcfe7 commit 12dce72
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
9 changes: 4 additions & 5 deletions src/core/output/outputGenerate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import { RepopackError } from '../../shared/errorHandle.js';
import { generateTreeString } from '../file/fileTreeGenerate.js';
import type { ProcessedFile } from '../file/fileTypes.js';
import type { OutputGeneratorContext } from './outputGeneratorTypes.js';
import { getMarkdownTemplate } from './outputStyles/markdownStyle.js';
import { getXmlTemplate } from './outputStyles/xmlStyle.js';
import { getPlainTemplate } from './outputStyles/plainStyle.js';
import {
generateHeader,
generateSummaryAdditionalInfo,
Expand All @@ -17,7 +14,9 @@ import {
generateSummaryPurpose,
generateSummaryUsageGuidelines,
} from './outputStyleDecorate.js';

import { getMarkdownTemplate } from './outputStyles/markdownStyle.js';
import { getPlainTemplate } from './outputStyles/plainStyle.js';
import { getXmlTemplate } from './outputStyles/xmlStyle.js';

const createRenderContext = (outputGeneratorContext: OutputGeneratorContext) => {
return {
Expand All @@ -35,7 +34,7 @@ const createRenderContext = (outputGeneratorContext: OutputGeneratorContext) =>
treeString: outputGeneratorContext.treeString,
processedFiles: outputGeneratorContext.processedFiles,
};
}
};

export const generateOutput = async (
rootDir: string,
Expand Down
5 changes: 2 additions & 3 deletions src/core/output/outputStyles/markdownStyle.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import Handlebars from 'handlebars';

export const getMarkdownTemplate = () => {

return /* md */ `
return /* md */ `
{{{generationHeader}}}
# File Summary
Expand Down Expand Up @@ -50,7 +49,7 @@ export const getMarkdownTemplate = () => {
{{{instruction}}}
{{/if}}
`;
}
};

Handlebars.registerHelper('getFileExtension', (filePath) => {
const extension = filePath.split('.').pop()?.toLowerCase();
Expand Down
3 changes: 1 addition & 2 deletions src/core/output/outputStyles/plainStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const PLAIN_SEPARATOR = '='.repeat(16);
const PLAIN_LONG_SEPARATOR = '='.repeat(64);

export const getPlainTemplate = () => {

return `
{{{generationHeader}}}
Expand Down Expand Up @@ -67,4 +66,4 @@ ${PLAIN_LONG_SEPARATOR}
{{/if}}
`;
}
};
5 changes: 2 additions & 3 deletions src/core/output/outputStyles/xmlStyle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export const getXmlTemplate = () => {

return /* xml */ `
return /* xml */ `
{{{generationHeader}}}
<file_summary>
Expand Down Expand Up @@ -58,4 +57,4 @@ This section contains the contents of the repository's files.
</instruction>
{{/if}}
`;
}
};
1 change: 0 additions & 1 deletion tests/core/output/outputStyles/markdownStyle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ describe('markdownStyle', () => {

const output = await generateOutput(process.cwd(), mockConfig, [], []);


expect(output).toContain('# File Summary');
expect(output).toContain('# Repository Structure');
expect(output).toContain('# Repository Files');
Expand Down
3 changes: 1 addition & 2 deletions tests/core/output/outputStyles/xmlStyle.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import process from 'node:process';
import { beforeEach, describe, expect, test, vi } from 'vitest';
import { createMockConfig } from '../../../testing/testUtils.js';
import { generateOutput } from '../../../../src/core/output/outputGenerate.js';

import { createMockConfig } from '../../../testing/testUtils.js';

vi.mock('fs/promises');

Expand Down

0 comments on commit 12dce72

Please sign in to comment.