Skip to content

Commit

Permalink
Add codespell to precommit and fix typos found (#424)
Browse files Browse the repository at this point in the history
* Add codespell config

* Fix typos across all files

* Add codespell check in pre-commit
  • Loading branch information
rdimaio authored Feb 17, 2025
1 parent 19a63ca commit 7367c98
Show file tree
Hide file tree
Showing 25 changed files with 52 additions and 44 deletions.
4 changes: 4 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
skip = *.pdf,*.json,*.svg
count =
quiet-level = 3
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ repos:
name: Check the file names for inconsistencies.
entry: ./tools/check-file-names.sh
language: system
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ rules.
#### Isort

[`isort`](https://github.com/pycqa/isort) is used to sort the python
imports. Thes imports are also grouped together by different categories, which
imports. These imports are also grouped together by different categories, which
makes it easier to read the source code.

#### Flake8
Expand Down
2 changes: 1 addition & 1 deletion docs/about_our_contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: about_our_contributors
title: About Our Contributors
---

Below is a list of contibutors who have contributed to the
Below is a list of contributors who have contributed to the
source code & their employers.

Should you wish to contribute to the Rucio source code or the documentation,
Expand Down
6 changes: 3 additions & 3 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ development mailing list [__rucio-dev@cern.ch__](mailto:rucio-dev@cern.ch).
A contribution can be either be a **patch** or **feature**:

* **Patches** include bugfixes and minor changes to the code and are included in
patches that are usually relased every two weeks.
patches that are usually released every two weeks.
* **Features** include major developments or potentially disruptive changes and
are included in feature releases made multiple times a year.

Expand Down Expand Up @@ -71,7 +71,7 @@ The following figure might help you with an overview:

Also, the [`pre-commit` python](https://pre-commit.com/) package is configured
for this repository. The `pre-commit` hook checks the syntax and format of the
files before commiting. This saves time in the development process, since
files before committing. This saves time in the development process, since
minor errors are noticed before submission.

To install the package and activate the hooks for the project:
Expand Down Expand Up @@ -229,7 +229,7 @@ variables as follows:

* `PARALLEL_AUTOTESTS_PROCNUM` (1,) (default: 3)

Specifies the number of processes to run and therefor the concurrently run
Specifies the number of processes to run and therefore the concurrently run
autotests. 3 will usually result in more than 8 GB RAM usage and a fair
amount of load on the PC.

Expand Down
2 changes: 1 addition & 1 deletion docs/developer/dependency_management.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ For critical security updates, we rely on [Dependabot](https://github.com/depend
to create alerts for dependencies listed in our requirements.

Dependabot supports `pip-compile`, and is able to automatically create PRs
to ugprade both primary and secondary dependencies.
to upgrade both primary and secondary dependencies.
When a primary dependency is upgraded in a `.in` file, Dependabot re-compiles
that file into the `.txt` file as well.

Expand Down
2 changes: 1 addition & 1 deletion docs/developer/setting_up_vscode_dev_env.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ For local development machines with limited resources `(<16 GB RAM, < 4 Cores)`,

Local development has been tested only on Linux hosts.
Remote development has been tested on Linux(for the remote VM) and Linux/MacOS(for the local instance of vscode).
The additional steps required for setting up a remote development environment are described in the sections begininng with `Remote Only: `. These sections can be ignored if you are setting up a local development environment.
The additional steps required for setting up a remote development environment are described in the sections beginning with `Remote Only: `. These sections can be ignored if you are setting up a local development environment.

## Prerequisites

Expand Down
2 changes: 1 addition & 1 deletion docs/developer/style_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ flake8 --extend-ignore {codes to ignore} /your/code/path

## Imports
* Never import using `from x import *`
* Order alphabetically, then seperated into sections for internal and external dependencies. Group internal imports at the end of the block, and group imports from the same external package.
* Order alphabetically, then separated into sections for internal and external dependencies. Group internal imports at the end of the block, and group imports from the same external package.
* Order modules such that `import {packageA}` is before `from {packageB} import {Module}`
* Do not import whole packages when single modules would suffice.
* Unused imports must be removed.
Expand Down
4 changes: 2 additions & 2 deletions docs/developer/type_annotation_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ from some consequences. In particular:
programming languages.
- Type related bugs do not get noticed: Calling a function with a wrong type
(e.g. `None`) gets spotet by typed checkers. In dynamically typed programming
languages this needs to be veryfied on every call.
languages this needs to be verified on every call.

While we have strong arguments for type annotations, there are some drawbacks:

Expand Down Expand Up @@ -164,7 +164,7 @@ As of now, only the number of _missing_ type annotations will be used. The job
does not check for wrong type hints or inconsistencies. This (specifically
`mypy`) will be enabled once enough python type hints are added. For this
purpose, we will always add type annotations to functions, even when the type
can be infered.
can be inferred.

### Best Practices

Expand Down
4 changes: 2 additions & 2 deletions docs/developer/webui/streamedtables.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const tablecolumns: any[] = [
</span>
)
},
// funxtion to render header cell of column, return JSX object
// function to render header cell of column, return JSX object
// "info": context useful for the creation of a header cell -> read docs
header: info => {
return (
Expand Down Expand Up @@ -255,7 +255,7 @@ type TableFilterDiscrete<T> = JSX.IntrinsicElements["div"] & {
}
```
Explanation:
* `keys` is a list of type `T` where `T` is the tyoe of the column entries.
* `keys` is a list of type `T` where `T` is the type of the column entries.
Usually a string enum.
* `renderFunc` is the function used to render the icon to the side or below the
text (depending on whether `state` is set).
Expand Down
4 changes: 2 additions & 2 deletions docs/developer/webui/webui_frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Classes are assigned to the `className` attribute as space-separated strings.
We often make use of the `twMerge` function. This function swallows all string arguments
and returns a single class string. Importantly, classes added later may override those added
before them, which is not the case when we do not use `twMerge`. An example of this
is seen in the followin code-block.
is seen in the following code-block.

```tsx
<div
Expand Down Expand Up @@ -395,7 +395,7 @@ case, branching logic is used to style the button depending on whether it is dis
```
We will cover how we conventionally structure the contents of `className` and `twMerge`.
We will also discuss dark mode and responsive desgin as examples of metaclasses, but
We will also discuss dark mode and responsive design as examples of metaclasses, but
we strongly encourage you to work through the Tailwind documentation, which is full of
examples and very helpful. In addition, it is a good idea to look at external resources
to fully understand the flexbox and other display models in HTML.
Expand Down
2 changes: 1 addition & 1 deletion docs/operator/administration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The behavior is very simple: any file found in the `/patch/*` directory inside
the containers will be fed to the `patch` command-line tool in the order
returned by this glob matching.

The procedures described bellow are only intended for temporary fixes. If a
The procedures described below are only intended for temporary fixes. If a
permanent change is needed, we highly encourage you to open a pull request
in rucio to spare you the toil related to maintaining your own local patch set.

Expand Down
16 changes: 8 additions & 8 deletions docs/operator/configuration_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: configuration_parameters
title: Configuration parameters
---
Description of the configuration parameters splitted in three different places:
Description of the configuration parameters split in three different places:
Rucio configuration file (`rucio.cfg`), Rucio configuration table and RSE attributes.

## Rucio Configuration File (`rucio.cfg`)
Expand Down Expand Up @@ -147,11 +147,11 @@ Rucio will look for the config in the following locations -
x509_proxy, gss, ssh, saml, oidc}`.
- **ca_cert**: Path of the cert file for HTTPS. Example:
`/opt/rucio/etc/web/ca.crt`.
- **client_cert**: Path of the X.509 client cert file. This can be overwitten
- **client_cert**: Path of the X.509 client cert file. This can be overwritten
by the `RUCIO_CLIENT_CERT` environment variable. Example:
`/opt/rucio/etc/web/client.crt`.
- **client_key**: Path of the X.509 client key file for the cert defined in
`client_cert`. This can be overwitten by the `RUCIO_CLIENT_KEY` environment
`client_cert`. This can be overwritten by the `RUCIO_CLIENT_KEY` environment
variable. Example: `/opt/rucio/etc/web/client.key`.
- **client_x509_proxy**: Path of the X.509 client proxy. Mandatory if
`auth_type = x509_proxy`.
Expand Down Expand Up @@ -494,7 +494,7 @@ and how to set them up [here](./configuration.md#creating-new-rses).
- **availability_delete**: Boolean. Control if this RSE allows deletions by the Reaper daemon using any protocol. Default: `True`.
- **availability_read**: Boolean. Control if this RSE allows reads using any protocol. Default: `True`.
- **availability_write**: Boolean. Control if this RSE allows writes using any protocol. Default: `True`.
- **credentials**: Dictonary[String, Any]: Specify token credentials used for accessing this RSE if it is in a commercial cloud. No default.
- **credentials**: Dictionary[String, Any]: Specify token credentials used for accessing this RSE if it is in a commercial cloud. No default.
- **delete_protocol**: Integer: Cannot be changed. Controls matching of protocol priorities for deletions. Default: `1`.
- **deterministic**: Boolean: Controls if the RSE is allowed to generate paths based solely on the DID (scope:filename). More info about non-deterministic RSEs [here](https://rucio.github.io/documentation/started/concepts/replica_workflow/#replica-paths-on-storage). Default: `True`.
- **domain**: List[String]: Specifies the locations this RSE may be accessed by clients from. Cannot be changed.
Expand All @@ -509,7 +509,7 @@ and how to set them up [here](./configuration.md#creating-new-rses).
- **third_party_copy_read_protocol**: Integer: Cannot be changed. Controls matching of protocol priorities for TPC reads. Default `1`.
- **third_party_copy_write_protocol**: Integer: Cannot be changed. Controls matching of protocol priorities for TPC writes. Default `1`.
- **verify_checksum**: Boolean: Specifies if the RSE has support for checksum verification. Default: `True`.
- **volatile**: Boolean. Specifies if the RSE is cache storage. Subject to volatile RSE retrictions detailed [here](https://rucio.github.io/documentation/operator/qos_rse_config). Default: `False`.
- **volatile**: Boolean. Specifies if the RSE is cache storage. Subject to volatile RSE restrictions detailed [here](https://rucio.github.io/documentation/operator/qos_rse_config). Default: `False`.
- **write_protocol**: Integer: Cannot be changed. Controls matching of protocol priorities for writes. Default: `1`.

## RSE attributes
Expand All @@ -531,10 +531,10 @@ and how to set them up [here](./configuration.md#creating-new-rses).
- **driver_name_rse_attribute**: String. Used to specify alternate drivers when using the Bittorrent transfer manager. Default: `bittorrent_driver`.
- **fts**: String. Specify the REST API URL of the FTS3 transfer manager. No default.
- **greedyDeletion**: Boolean. Allow files without a rule locking them to be deleted by a Reaper Daemon. Default behavior only marks a file for deletion when there is no space on an RSE for a new required file. Default: `False`.
- **group_by_rse_attribute**: String. Control the RSE attribute (such as `country`) which transfer source RSEs will be grouped by when determining an appopriate transfer source. Default: `UNKNOWN`.
- **group_by_rse_attribute**: String. Control the RSE attribute (such as `country`) which transfer source RSEs will be grouped by when determining an appropriate transfer source. Default: `UNKNOWN`.
- **globus_endpoint_id**: String. Specify the REST API URL of the Globus transfer manager. No default.
- **hop_penalty**: Integer. Usage cost of this RSE as an intermediate in [multihop transfers](https://rucio.github.io/documentation/operator/transfers/transfers-overview). Overrides the global `transfers/hop_penalty` configuration for this particular RSE.
Requires `available_for_multihop` attribute is True on the RSE. No default.
Requires `available_for_multihop` attribute is True on the RSE. No default.
- **is_object_store**: Boolean. Control the auditor daemon's behavior. Instead of dumping all files, list them by date. Default: `False`.
- **istape**: Boolean. Default: `False`.
- **lfn2pfn_algorithm**: String. Name of the algorithm to be used for generating paths to files on the storage. Must be defined in the configured policy package. Default: `default`.
Expand All @@ -543,7 +543,7 @@ and how to set them up [here](./configuration.md#creating-new-rses).
- **naming_convention**: String. Name of the algorithm in the configured policy package which is to be used to validate DIDs on this RSE. Default: `None`.
- **oidc_support**: Boolean. Specifies that the RSE supports OIDC authentication for FTS3 transfers. Default: `False`.
- **overwrite_when_only_on_disk**: Boolean. On a `TAPE` RSE, controls if a file can be overwritten. A file may only be overwritten if it has not yet been written to the tape backend. Default: `False`.
- **overwrite**: Boolean. Controls if a file can be overwritten on the RSE. Default: `True` for `rse_type: DISK`. `False` for `rse_type: TAPE`.
- **overwrite**: Boolean. Controls if a file can be overwritten on the RSE. Default: `True` for `rse_type: DISK`. `False` for `rse_type: TAPE`.
- **physgroup**: String. Used for grouping of rules by CERN experiments. Default: ` `.
- **qbittorrent_management_address**: String. Used to configure the URL of the bittorrent management API when using the torrent transfer manager. No Default.
- **quota_approvers**: List[string]. List of Rucio users separated by commas. Only used in the permission layer of the policy package, and likely specific to the CERN experiments only. Default: `None`.
Expand Down
4 changes: 2 additions & 2 deletions docs/operator/k8s_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Please notice that in this case, the various credentials will have to be properl
>In order to [protect devices connected to the CERN network](https://security.web.cern.ch/services/en/firewall.shtml) from the regular attacks initiated from off-site, **incoming connections to all CERN devices are blocked** in the CERN outer perimeter firewall by default. In addition, source ports **0-1023/TCP and 0-1023/UDP (except 500/UDP) are blocked by default** for outgoing connections. Thus, users can initiate client applications (on so-called higher ports) but not expose server processes.
To comply with the CERN security rules, we need to use the so-called LANDB sets, where the firewall has static openings automatically set up. Usually, such sets are used for redudancy or large, homogeneous services. These sets are either managed by the Computer Security Team or by the service managers themselves.
To comply with the CERN security rules, we need to use the so-called LANDB sets, where the firewall has static openings automatically set up. Usually, such sets are used for redundancy or large, homogeneous services. These sets are either managed by the Computer Security Team or by the service managers themselves.
Create a [new LanDB set](https://landb.cern.ch/portal/sets/create), following the recommendations:
1. Type: Interdomain
Expand Down Expand Up @@ -347,7 +347,7 @@ A few remarks:
- The db secret is being mounted on `config.database.default` in order to allow the user to correctly access it.
- `hostcert.pem`, `hostkey.pem` and `ca.pem` are automatically detected, so they don't need to be mounted. Nevertheless, the corresponding secrets must be created (see next sections).
- The GridCA cert is needed to verify all the other certs. Please look at this [git commit](https://gitlab.cern.ch/rucio-it/flux-compass/-/commit/688da7285833dafd1bbe25469f35c6059d7af24f) used to set the `GridCA` file in `/etc/grid-security/certificate`.
- Together with this, is also necessary to setup the correspoding variable `RUCIO_CA_PATH`
- Together with this, is also necessary to setup the corresponding variable `RUCIO_CA_PATH`
- The `RUCIO_SSL_PROTOCOL` variable must be explicitly set.
Please notice that in order to have LBs produced, ***the Helm chart must be applied***.
Expand Down
8 changes: 4 additions & 4 deletions docs/operator/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ daemons.conveyor.throttler.set_rse_transfer_limits.\
[rse].max_transfers/transfers/waitings (gauge)
daemons.conveyor.throttler.delete_rse_transfer_limits.[rse] (counter)
daemons.conveyor.throttler.delete_rse_transfer_limits.[activity].[rse] (counter)
daemons.conveyor.throttler.set_rse_transfer_limits.[activitiy].[rse] (gauge)
daemons.conveyor.throttler.set_rse_transfer_limits.[activity].[rse] (gauge)
daemons.conveyor.throttler.release_waiting_requests.[activity].[rse].[account] (counter)
```

Expand Down Expand Up @@ -283,7 +283,7 @@ Rucio.
activity: activity of the request
bytes: size of the transferred file (byte)
checksum-adler: checksum using adler algorithm
checksum-md5: checksum using md5 alrogithm
checksum-md5: checksum using md5 algorithm
created_at: Time when the message was created (yyyy-MM-dd HH:mm:ss.SSSSSS)
dst-rse: destination rse
dst-type: type of destination rse (disk, tape)
Expand All @@ -304,7 +304,7 @@ Rucio.
src-type: type of source rse (disk, tape)
src-url: source file url
started_at: start time of the transfer
submitted_at: submittion time of the transfer
submitted_at: submission time of the transfer
tool-id: id of the transfer tool in rucio (rucio-conveyor)
transfer-endpoint: endpoint holder of the transfer (fts)
transfer-id: uuid of this transfer
Expand Down Expand Up @@ -370,7 +370,7 @@ resolve different UUIDs in Kibana.
## Access monitoring

The traces are sent by the pilots or the rucio clients whenever a file is
downloaded/uploaded. This is simillar with the data transferring monitoring.
downloaded/uploaded. This is similar with the data transferring monitoring.

## Rucio database dumping

Expand Down
8 changes: 4 additions & 4 deletions docs/operator/multi_vo_rucio.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ multi_vo = True
```

For the daemons, files and configuration are needed to allow daemons to act on
the various VOs: this inludes the VO specific certificates, keys, and proxies,
the various VOs: this includes the VO specific certificates, keys, and proxies,
as well as an additional configuration section which maps each VO to its
respective x.509 authentication credentials. Rucio uses this information when
submitting and polling transfers to use the correct certificates.
Expand Down Expand Up @@ -99,7 +99,7 @@ is disabled by default.

When bootstrapping the database as part of the Rucio installation, if M-VO is
enabled in `rucio.cfg` then the super_root account is created automatically. The
default VO "def" is also created, and the super_root acccount is associated with
default VO "def" is also created, and the super_root account is associated with
it. The identity used to access this account can be managed in the usual way.

## Creating VOs
Expand Down Expand Up @@ -150,7 +150,7 @@ with minimal disruption. The tools to perform this can be found in
and further documentation on the [single VO to multi VO](#s-vo-to-m-vo) and
[multi-VO to single VO](#m-vo-to-s-vo) instances are found below.

The fuction `convert_to_mvo` facilitates the conversion of a single-VO instance
The function `convert_to_mvo` facilitates the conversion of a single-VO instance
to a multi-VO instance, where `convert_to_svo` performs the opposite. VOs can
also be renamed using `rename_vo`, or deleted using `remove_vo`. The conversion
functions are callable by using the command line with details on what each
Expand Down Expand Up @@ -256,7 +256,7 @@ REFERENCES accounts (account);
By default, data associated with any other VOs is left in the database, but will
be inaccessible to Rucio users.
These entries can be completely deleted from the database
by pasing the `--delete_vos` argument.
by passing the `--delete_vos` argument.

```bash
tools/convert_database_vo.py convert_to_svo old --delete_vos ... \
Expand Down
Loading

0 comments on commit 7367c98

Please sign in to comment.