Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
exclude: ^user_docs/(?!en/).*$

# https://pre-commit.ci/
# Configuration for Continuous Integration service
ci:
# Can't run Windows scripts on Linux
# These also do not apply fixes, only run tests
skip: [scons-source, checkPot, unitTest, licenseCheck]
submodules: true
autoupdate_commit_msg: "Pre-commit autoupdate"
autofix_commit_msg: "Pre-commit autofix"
Comment on lines +10 to +11

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
autoupdate_commit_msg: "Pre-commit autoupdate"
autofix_commit_msg: "Pre-commit autofix"
autoupdate_commit_msg: "Pre-commit automatic update"
autofix_commit_msg: "Pre-commit automatic fix"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you open a small PR to fix this up. Maybe auto-fix and auto-update instead?


repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
# Checks python syntax
- id: check-ast
exclude: source/comInterfaces/_944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0.py
Comment thread
seanbudd marked this conversation as resolved.
Resolved
- id: check-case-conflict
- id: check-merge-conflict
- id: trailing-whitespace
Expand Down
36 changes: 24 additions & 12 deletions projectDocs/dev/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,30 @@ If you are new to the project, or looking for some way to help take a look at:
- Run `scons checkPot` to ensure translatable strings have comments for the translators
- Run `runlicensecheck.bat` to check that you don't introduce any new python dependencies with incompatible licenses.
1. [Create a change log entry](#change-log-entry)
1. [Create a Pull Request (PR)](./githubPullRequestTemplateExplanationAndExamples.md)
- When you think a contribution is ready, or you would like feedback, open a draft pull request.
When you would like a review, mark the PR as "ready for review".
- Please fill out the Pull Request template, including the checklist of considerations.
The checklist asks you to confirm that you have thought about each of the items, if any of the items are missing it is helpful to explain elsewhere in the PR why it has been left out.
- Automated checks will be run against your PR.
If these fail, please review them.
Sometimes system tests fail unexpectedly.
If you believe the failure is unrelated, feel free to ignore it unless it is raised by a reviewer.
- All pull requests submitted must have their "Allow edits from maintainers" checkbox ticked.
This is the GitHub default for new pull requests.
- A lead developer may specifically request the pull request be made against `beta` or `rc` in the case of addressing bugs introduced in the current release cycle.
1. Create a Pull Request (PR)
1. Filling out the template:
- [Template guide](./githubPullRequestTemplateExplanationAndExamples.md)
- Please fill out the Pull Request template, including the checklist of considerations.
The checklist asks you to confirm that you have thought about each of the items, if any of the items are missing it is helpful to explain elsewhere in the PR why it has been left out.
1. Submission process:
- If you would like to publish unfinished work to seek early feedback or demonstrate an approach, open a draft pull request.
When you would like a code review or response from NV Access, mark the PR as "ready for review".
- All pull requests submitted must have their "Allow edits from maintainers" checkbox ticked.
This is the GitHub default for new pull requests, except for organisation forks.
Organisation forks must invite NV Access developers to collaborate directly.
- Consider if the PR should be made against `beta` or `rc` in the case of addressing bugs introduced in the current release cycle.
1. CI/CD testing:
- Every time a PR has a commit pushed to it, CI/CD checks will be run
- [pre-commit.ci](https://pre-commit.ci/) will apply linting fixes.
- re-run pre-commit on a pull request by commenting `pre-commit.ci run`.
- prevent pre-commit from pushing by putting `[skip ci]`, `[ci skip]`, `[skip pre-commit.ci]`, or `[pre-commit.ci skip]` in the commit message.
- AppVeyor will build a copy of NVDA when changes are pushed to your PR.
A build artifact will be created for a successful build to allow for testing the PR.
- AppVeyor will run system tests and other tests.
If these fail, please review them.
Sometimes system tests fail unexpectedly.
If you believe the failure is unrelated, feel free to ignore it unless it is raised by a reviewer.
- Security checks will be run.
1. Participate in the code review process
- This process requires core NVDA developers to understand the intent of the change, read the code changes, asking questions or suggesting changes.
Please participate in this process, answering questions, and discussing the changes.
Expand Down
10 changes: 9 additions & 1 deletion projectDocs/testing/automated.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ These tests help to ensure that code changes do not unintentionally break functi
[Pre-commit hooks](https://pre-commit.com/) can be used to automatically run linting, translatable string checks and unit tests on files staged for commit.
This will automatically apply lint fixes where possible, and will cancel the commit on lint issues and other test failures.

From a shell, set up pre-commit scripts for your NVDA python environment:
From a shell, [set up pre-commit scripts](https://pre-commit.com/#pre-commit-install) for your NVDA python environment:

1. `venvUtils\ensureAndActivate.bat`
1. `pre-commit install`
Expand All @@ -21,6 +21,14 @@ Alternatively, set up pre-commit scripts globally:
To skip pre-commit hooks from triggering, use the `--no-verify` CLI option.
Example: `git commit -m "message" --no-verify`.

#### Manually running pre-commit hooks

You can run pre-commit hooks manually with [`pre commit run`](https://pre-commit.com/#pre-commit-run).

- You can filter files with `--files` and `--all-files`
- You can also compare two revisions:
`pre-commit run --from-ref origin/master --to-ref HEAD`

### Translatable string checks

To run the translatable string checks (which check that all translatable strings have translator comments), run:
Expand Down
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ Their contribution helps us maintain the security and integrity of our releases.
## Contributing to NVDA
If you would like to contribute to NVDA, you can read more information in our [contributing guide](./.github/CONTRIBUTING.md).
This includes information on reporting issues, triaging issues, testing, translating, contributing code/documentation and creating add-ons.

## Status checks

* Alpha build status: [![Alpha build status](https://ci.appveyor.com/api/projects/status/sqeer6p8lc80lvqe/branch/master?svg=true)](https://ci.appveyor.com/project/NVAccess/nvda/branch/master)
* Beta build status: [![Beta build status](https://ci.appveyor.com/api/projects/status/sqeer6p8lc80lvqe/branch/beta?svg=true)](https://ci.appveyor.com/project/NVAccess/nvda/branch/beta)
* Pre-commit status (master): [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/nvaccess/nvda/master.svg)](https://results.pre-commit.ci/latest/github/nvaccess/nvda/master)
* CodeQL security analysis status (master): [![CodeQL security analysis status](https://github.com/nvaccess/nvda/actions/workflows/github-code-scanning/codeql/badge.svg?branch=master)](https://github.com/nvaccess/nvda/actions/workflows/github-code-scanning/codeql?query=branch%3Amaster)
Comment thread
seanbudd marked this conversation as resolved.
Resolved
2 changes: 1 addition & 1 deletion source/speech/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _getFormattedDevInfo(self):
def __repr__(self):
return (
f"CancellableSpeech ("
f"{ 'cancelled' if self._checkIfCancelled() else 'still valid' }"
f"{ 'cancelled' if self._checkIfCancelled() else 'still valid'}"
f"{self._getFormattedDevInfo()}"
f")"
)
Expand Down