Skip to content

Commit

Permalink
new commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaRaimec22 committed Apr 14, 2024
2 parents 4bf0319 + 2c36281 commit cc1c4ed
Show file tree
Hide file tree
Showing 249 changed files with 24,239 additions and 9,242 deletions.
29 changes: 13 additions & 16 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"plugin:jest/recommended",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"eslint-config-prettier",
"prettier"
],
"globals": {
Expand All @@ -33,12 +34,12 @@
"@typescript-eslint",
"jest",
"import",
"eslint-plugin-tsdoc"
"eslint-plugin-tsdoc",
"prettier"
],
"rules": {
"react/destructuring-assignment": ["off"],
// "@typescript-eslint/no-explicit-any": ["off"],
"@typescript-eslint/explicit-module-boundary-types": ["off"],
"react/destructuring-assignment": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"react/no-multi-comp": [
"error",
{
Expand All @@ -54,7 +55,7 @@
"import/no-duplicates": "error",
"tsdoc/syntax": "error",
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
"@typescript-eslint/no-non-null-assertion": "error",
Expand Down Expand Up @@ -111,7 +112,11 @@
"leadingUnderscore": "require"
},

{ "selector": "variable", "modifiers": ["exported"], "format": null }
{
"selector": "variable",
"modifiers": ["exported"],
"format": null
}
],
// Ensures that components are always written in PascalCase
"react/jsx-pascal-case": [
Expand All @@ -126,21 +131,13 @@
// All tests must need not have an assertion
"jest/expect-expect": 0,

"react/jsx-tag-spacing": [
"warn",
{
"afterOpening": "never",
"beforeClosing": "never",
"beforeSelfClosing": "always"
}
],

// Enforce Strictly functional components
"react/no-unstable-nested-components": ["error", { "allowAsProps": true }],
"react/function-component-definition": [
0,
{ "namedComponents": "function-declaration" }
]
],
"prettier/prettier": "error"
},

// Let ESLint use the react version in the package.json
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/authorized-changes-detection.yml

This file was deleted.

132 changes: 0 additions & 132 deletions .github/workflows/count_changed_files.py

This file was deleted.

76 changes: 64 additions & 12 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Count number of lines
run: |
chmod +x ./.github/workflows/countline.py
./.github/workflows/countline.py --lines 600 --exclude_files src/screens/LoginPage/LoginPage.tsx src/GraphQl/Queries/Queries.ts
./.github/workflows/countline.py --lines 600 --exclude_files src/screens/LoginPage/LoginPage.tsx src/GraphQl/Queries/Queries.ts src/screens/OrgList/OrgList.tsx src/GraphQl/Mutations/mutations.ts
- name: Get changed TypeScript files
id: changed-files
Expand All @@ -52,9 +52,11 @@ jobs:
if: steps.changed-files.outputs.only_changed != 'true'
run: npm run typecheck

- name: Run linting check
- name: Check for linting errors in modified files
if: steps.changed-files.outputs.only_changed != 'true'
run: npm run lint:check
env:
CHANGED_FILES: ${{ steps.changed_files.outputs.all_changed_files }}
run: npx eslint ${CHANGED_FILES}

- name: Check for localStorage Usage
run: |
Expand All @@ -74,22 +76,72 @@ jobs:
echo "Error: Source and Target Branches are the same. Please ensure they are different."
exit 1
Check-Changed-Files:
name: File count, sensitive files and branch check
Check-Unauthorized-Changes:
name: Checks if no unauthorized files are changed
runs-on: ubuntu-latest
# needs: Code-Quality-Checks
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5

- name: Get Changed Unauthorized files
id: changed-unauth-files
uses: tj-actions/changed-files@v40
with:
python-version: 3.9
files: |
.github/**
env.example
.node-version
.husky/**
scripts/**
package.json
tsconfig.json
.gitignore
.eslintrc.json
.eslintignore
vite.config.ts
docker-compose.yaml
Dockerfile
CODEOWNERS
LICENSE
setup.ts
- name: List all changed unauthorized files
if: steps.changed-unauth-files.outputs.any_changed == 'true' || steps.changed-unauth-files.outputs.any_deleted == 'true'
env:
CHANGED_UNAUTH_FILES: ${{ steps.changed-unauth-files.outputs.all_changed_files }}
run: |
for file in ${CHANGED_UNAUTH_FILES}; do
echo "$file is unauthorized to change/delete"
done
exit 1
- name: Run Python script
Count-Changed-Files:
name: Checks if number of files changed is acceptable
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40

- name: Echo number of changed files
env:
CHANGED_FILES_COUNT: ${{ steps.changed-files.outputs.all_changed_files_count }}
run: |
python .github/workflows/count_changed_files.py --base_branch "${{ github.base_ref }}" --pr_branch "${{ github.head_ref }}"
echo "Number of files changed: $CHANGED_FILES_COUNT"
- name: Check if the number of changed files is less than 100
if: steps.changed-files.outputs.all_changed_files_count > 100
env:
CHANGED_FILES_COUNT: ${{ steps.changed-files.outputs.all_changed_files_count }}
run: |
echo "Error: Too many files (greater than 100) changed in the pull request."
echo "Possible issues:"
echo "- Contributor may be merging into an incorrect branch."
echo "- Source branch may be incorrect please use develop as source branch."
exit 1
Check-ESlint-Disable:
name: Check for eslint-disable
Expand Down
2 changes: 1 addition & 1 deletion INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This document provides instructions on how to set up and start a running instanc

# Prerequisites for Developers

We recommend that you follow these steps before beginning development work on Talawa-Admin:
We recommend that you to follow these steps before beginning development work on Talawa-Admin:

1. You need to have `nodejs` installed in your machine. We recommend using Node version greater than 20.0.0. You can install it either through [nvm](https://github.com/nvm-sh/nvm) (Node Version Manager) or by visiting the official [Nodejs](https://nodejs.org/download/release/v16.20.2/) website.
1. [Talawa-API](https://github.com/PalisadoesFoundation/talawa-api): (**This is mandatory**) The API system that the mobile app uses for accessing data. Setup your own **_local instance_**
Expand Down
2 changes: 1 addition & 1 deletion ISSUE_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Working on these types of existing issues is a good way of getting started with
Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the mentors of the merits of this feature. Please provide as much detail and context as possible.

### Monitoring the Creation of New Issues
1. Join our `#talawa-github` slack channel for automatic issue and pull request updates
1. Join our `#talawa-github` slack channel for automatic issue and pull request updates.

## General Guidelines

Expand Down
Loading

0 comments on commit cc1c4ed

Please sign in to comment.