Skip to content

Commit

Permalink
feat(github-action): Add more styling based on discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvassallo committed May 23, 2024
1 parent e6be064 commit 4a35191
Show file tree
Hide file tree
Showing 11 changed files with 136 additions and 114 deletions.
21 changes: 17 additions & 4 deletions action/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ rules:
'prettier/prettier': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'semi': 'error',
'semi-style': 'error',
'semi': ['error', 'always'],
'semi-style': ['error', 'last'],
'filenames/match-regex': 'off',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/await-thenable': 'error',
Expand Down Expand Up @@ -81,8 +81,21 @@ rules:
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'error',
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/semi': 'error',
'@typescript-eslint/semi': ['error', 'always'],
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/unbound-method': 'error'
'@typescript-eslint/unbound-method': 'error',
'func-style': ['error', 'declaration', { 'allowArrowFunctions': false }],
'sort-imports':
[
'error',
{
'ignoreCase': false,
'ignoreDeclarationSort': false,
'ignoreMemberSort': false,
'memberSyntaxSortOrder': ['none', 'all', 'multiple', 'single'],
'allowSeparatedGroups': false
}
],
'sort-keys': ['error', 'asc', {'caseSensitive': true, 'natural': false, 'minKeys': 2}]
}
108 changes: 56 additions & 52 deletions action/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion action/dist/index.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions action/src/checkoutRepository.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { exec } from '@actions/exec';
import { context } from '@actions/github';
import { exec } from '@actions/exec';

enum CheckoutRepositoryStrings {
Error = 'Error checking out repository'
Expand All @@ -9,7 +9,7 @@ enum CheckoutRepositoryStrings {
* Checkout the appropriate ref for the users changes.
* @returns {Promise<void>}
*/
export const checkoutRepository = async (): Promise<void> => {
export async function checkoutRepository(): Promise<void> {
const ref = context.payload.ref;
const repository = context.payload.repository?.full_name;
try {
Expand All @@ -26,6 +26,6 @@ export const checkoutRepository = async (): Promise<void> => {
} catch (error) {
throw new Error(`${CheckoutRepositoryStrings.Error}: ${error}`);
}
};
}

export default checkoutRepository;
18 changes: 10 additions & 8 deletions action/src/getConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ export type Config = {
* Returns the config values in JSON format
* @returns {Config}
*/
export const getConfig = (): Config => ({
rulesPath: core.getInput('rules'),
dataPath: core.getInput('data'),
token: core.getInput('token'),
checkout: core.getBooleanInput('checkout'),
analyze: core.getBooleanInput('analyze'),
createReview: core.getBooleanInput('create-review')
});
export function getConfig(): Config {
return {
analyze: core.getBooleanInput('analyze'),
checkout: core.getBooleanInput('checkout'),
createReview: core.getBooleanInput('create-review'),
dataPath: core.getInput('data'),
rulesPath: core.getInput('rules'),
token: core.getInput('token')
};
}

export default getConfig;
Loading

0 comments on commit 4a35191

Please sign in to comment.