Skip to content

Commit

Permalink
Replaced all occurences of pre_commit_linter (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
HardikGoyal2003 committed May 16, 2024
1 parent 78317f1 commit 97a65a7
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Angular-Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ There may be some style updates required to make sure that the pages look exactl
Python:
```console
python -m scripts.linters.pre_commit_linter
python -m scripts.linters.run_lint_checks
```
Docker:
Expand Down
6 changes: 3 additions & 3 deletions Coding-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,17 +366,17 @@ And then the variable can be loaded by `import functions from 'folder/folder/fun

You can invoke the pre-commit script to ensure that your code follows the coding guidelines for a particular file that you've modified by running the following command from the root directory:
```bash
python -m scripts.linters.pre_commit_linter --path filepath
python -m scripts.linters.run_lint_checks --path filepath
```

If you'd like to run the checks for a list of files, run the following command:
```bash
python -m scripts.linters.pre_commit_linter --files file_1 file_2 ... file_n
python -m scripts.linters.run_lint_checks --files file_1 file_2 ... file_n
```

If you'd like to run the checks for a list of file-types, run the following command:
```bash
python -m scripts.linters.pre_commit_linter --only-check-file-extensions file_extension_type_1 file_extension_type_2 ... file_extension_type_n
python -m scripts.linters.run_lint_checks --only-check-file-extensions file_extension_type_1 file_extension_type_2 ... file_extension_type_n
```

### Note for Sublime Text users
Expand Down
2 changes: 1 addition & 1 deletion Custom-ESLint-checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ To run the linter with your new rule, follow these steps:
3. Execute the pre-commit linter, which will use your new rule. To speed up the lint checks, we recommend running the rule on just a single file when testing it. If you created a `test.js` file with some code to try linting, you would run the linter like this:

```console
$ python -m scripts.linters.pre_commit_linter --path test.js
$ python -m scripts.linters.run_lint_checks --path test.js
...
----------------------------------------
Please fix the errors below:
Expand Down
2 changes: 1 addition & 1 deletion Custom-Pylint-checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Below, we'll walk through how to implement this rule using each of the three kin
To develop an intuition for how ASTs work, let's see how astroid represents some example `Hello, world!` code. Open a Python shell in your Oppia directory and import a file from Oppia like the pre-commit linter:

```python
>>> from scripts.linters import pre_commit_linter
>>> from scripts.linters import run_lint_checks
```

This import will modify your PYTHONPATH to include Oppia's Python dependencies, so you can now import [astroid](https://pylint.pycqa.org/projects/astroid/), which Pylint uses to generate the AST:
Expand Down
6 changes: 3 additions & 3 deletions Frequently-Asked-Questions.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ The basic pattern is to inspect an element and search for an unique class/keywor

### How to run only the linting test on a file?

There is a `pre_commit_linter.py` for linting the files. Let's say you want to run the linting tests on the file. In the oppia directory, run the following command.
There is a `run_lint_checks.py` for linting the files. Let's say you want to run the linting tests on the file. In the oppia directory, run the following command.

python -m scripts.linters.pre_commit_linter --path=path/to/the/file
python -m scripts.linters.run_lint_checks --path=path/to/the/file

### How to run only the linting test on a specific file type?

Let's say you want to run the linting tests on a specific file type. In the oppia directory, run the following command.

python -m scripts.linters.pre_commit_linter --only-check-file-extensions file_extension_type
python -m scripts.linters.run_lint_checks --only-check-file-extensions file_extension_type

### How to test email functionality?
Please refer to [Testing-email-functionality](https://github.com/oppia/oppia/wiki/Testing-email-functionality) for details.
Expand Down
2 changes: 1 addition & 1 deletion If-your-presubmit-check-fails.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

While committing or pushing the changes in the code that you made, we have certain checks and tests in place that run on your changes and verify that everything is in order and good to go. This means that, sometimes, you'll be unable to push your code because your changes are failing our tests and require some changes to be made. They can fail for reasons as simple as like missing a space or missing a newline, or using an invalid keyword, or missing docstrings. They might also fail due to [insufficient test coverage](https://github.com/oppia/oppia/wiki/Frontend-tests#generating-coverage-reports).

These tests are triggered automatically when you try to commit or push your changes, but you can also trigger these tests manually by running the command **python -m scripts.pre_commit_linter.** (See the top of scripts/pre_commit_linter.py for instructions on command-line args you can use to customize this script.)
These tests are triggered automatically when you try to commit or push your changes, but you can also trigger these tests manually by running the command **python -m scripts.run_lint_checks.** (See the top of scripts/run_lint_checks.py for instructions on command-line args you can use to customize this script.)

If the tests fail, you'll see the following in your terminal:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ Also make sure your PR meets all the points in the [codeowners checklist on the
<tr>
<td>/scripts/
</td>
<td>For pre_commit_linter.py, pylint_extensions.py and pylint_extensions_test.py, the added lint checks should be optimized and placed at the best location possible within the script.
<td>For run_lint_checks.py, pylint_extensions.py and pylint_extensions_test.py, the added lint checks should be optimized and placed at the best location possible within the script.
<p>
For other scripts, in general, the changes done should be optimum and do not affect the existing infrastructure negatively.
</td>
Expand Down
2 changes: 1 addition & 1 deletion Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ sudo apt-get install python3-matplotlib

### No Module appengine.api

If after running `python -m scripts.linters.pre_commit_linter`, you get an error that contains:
If after running `python -m scripts.linters.run_lint_checks`, you get an error that contains:

```
No module named appengine.api
Expand Down

0 comments on commit 97a65a7

Please sign in to comment.