Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…awa-admin into session-timeout
  • Loading branch information
JordanCampbell1 committed Oct 13, 2024
2 parents 0b4ea77 + e922a69 commit a21a99d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/eslint_disable_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ def has_eslint_disable(file_path):
Returns:
bool: True if eslint-disable statement is found, False otherwise.
"""
with open(file_path, 'r') as file:
content = file.read()
return re.search(r'//\s*eslint-disable', content)
eslint_disable_pattern = re.compile(r'//\s*eslint-disable(?:-next-line|-line)?', re.IGNORECASE)

try:
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()
return bool(eslint_disable_pattern.search(content))
except Exception as e:
print(f"Error reading file {file_path}: {e}")
return False

def check_eslint(directory):
"""
Expand Down Expand Up @@ -72,7 +78,6 @@ def arg_parser_resolver():
Returns:
result: Parsed argument object
"""
parser = argparse.ArgumentParser()
parser.add_argument(
Expand All @@ -98,7 +103,6 @@ def main():
Raises:
SystemExit: If an error occurs during execution.
"""

args = arg_parser_resolver()

if not os.path.exists(args.directory):
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
if: steps.changed-files.outputs.only_changed != 'true'
env:
CHANGED_FILES: ${{ steps.changed_files.outputs.all_changed_files }}
run: npx eslint ${CHANGED_FILES}
run: npx eslint ${CHANGED_FILES} && python .github/workflows/eslint_disable_check.py

- name: Check for TSDoc comments
run: npm run check-tsdoc # Run the TSDoc check script
Expand All @@ -80,6 +80,7 @@ jobs:
exit 1
Check-Unauthorized-Changes:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Checks if no unauthorized files are changed
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -122,6 +123,7 @@ jobs:
exit 1
Count-Changed-Files:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Checks if number of files changed is acceptable
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -212,6 +214,7 @@ jobs:
min_coverage: 95.0

Graphql-Inspector:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Runs Introspection on the GitHub talawa-api repo on the schema.graphql file
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -239,6 +242,7 @@ jobs:
run: graphql-inspector validate './src/GraphQl/**/*.ts' './talawa-api/schema.graphql'

Check-Target-Branch:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Check Target Branch
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ env:

jobs:
Code-Coverage:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Test and Calculate Code Coverage
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Core features include:
1. The `talawa` documentation can be found at our [docs.talawa.io](https://docs.talawa.io) site.
1. It is automatically generated from the markdown files stored in our [Talawa-Docs GitHub repository](https://github.com/PalisadoesFoundation/talawa-docs). This makes it easy for you to update our documenation.

# Videos
# Videos

1. Visit our [YouTube Channel playlists](https://www.youtube.com/@PalisadoesOrganization/playlists) for more insights
1. The "[Getting Started - Developers](https://www.youtube.com/watch?v=YpBUoHxEeyg&list=PLv50qHwThlJUIzscg9a80a9-HmAlmUdCF&index=1)" videos are extremely helpful for new open source contributors.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"preview": "vite preview --config config/vite.config.ts",
"test": "cross-env NODE_ENV=test jest --env=./scripts/custom-test-env.js --watchAll --coverage",
"eject": "react-scripts eject",
"lint:check": "eslint \"**/*.{ts,tsx}\" --max-warnings=0",
"lint:check": "eslint \"**/*.{ts,tsx}\" --max-warnings=0 && python .github/workflows/eslint_disable_check.py",
"lint:fix": "eslint --fix \"**/*.{ts,tsx}\"",
"format:fix": "prettier --write \"**/*.{ts,tsx,json,scss,css}\"",
"format:check": "prettier --check \"**/*.{ts,tsx,json,scss,css}\"",
Expand Down

0 comments on commit a21a99d

Please sign in to comment.