Skip to content

Commit 1d1ff53

Browse files
JasonGrace2282alanzhu0
authored andcommitted
chore: fix common linting problems
This also replaces f"{$1}" with str($1) to make the Alan formatting CI happy
1 parent 3fd1236 commit 1d1ff53

File tree

115 files changed

+480
-512
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+480
-512
lines changed

Ion.egg-info/PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Intranet 3
9292

9393
*Version 3.0.0*
9494

95-
Intranet3 (Ion) is the next-generation Intranet platform for `TJHSST
95+
Intranet3 (Ion) is the next-generation Intranet platform for `TJHSST
9696
<https://tjhsst.fcps.edu/>`_. Using Python, Django, Redis, Postgres, and many other technologies, Ion was developed from the ground up to be simple, well-documented, and extensible.
9797

9898
Documentation (in RestructuredText format) is available inside the "docs" folder or at https://tjcsl.github.io/ion publicly on the web.

Ion.egg-info/SOURCES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ intranet/static/img/logos/touch/touch-icon76.png
10241024
intranet/static/img/patterns/brushed.png
10251025
intranet/static/img/patterns/[email protected]
10261026
intranet/static/img/patterns/concrete_seamless.png
1027-
intranet/static/img/patterns/confectionary.png
1027+
intranet/static/img/patterns/confectionery.png
10281028
intranet/static/img/patterns/contemporary_china.png
10291029
intranet/static/img/patterns/contemporary_china_2.png
10301030
intranet/static/img/patterns/cream_pixels.png
@@ -1051,7 +1051,7 @@ intranet/static/img/patterns/[email protected]
10511051
intranet/static/img/patterns/dark/brushed.png
10521052
intranet/static/img/patterns/dark/[email protected]
10531053
intranet/static/img/patterns/dark/concrete_seamless.png
1054-
intranet/static/img/patterns/dark/confectionary.png
1054+
intranet/static/img/patterns/dark/confectionery.png
10551055
intranet/static/img/patterns/dark/contemporary_china.png
10561056
intranet/static/img/patterns/dark/contemporary_china_2.png
10571057
intranet/static/img/patterns/dark/cream_pixels.png

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Intranet 3
1111

1212
*Version 3.0.0*
1313

14-
Intranet3 (Ion) is the next-generation Intranet platform for `TJHSST
14+
Intranet3 (Ion) is the next-generation Intranet platform for `TJHSST
1515
<https://tjhsst.fcps.edu/>`_. Using Python, Django, Redis, Postgres, and many other technologies, Ion was developed from the ground up to be simple, well-documented, and extensible.
1616

1717
Documentation (in RestructuredText format) is available inside the "docs" folder or at https://tjcsl.github.io/ion publicly on the web.

SETUP.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The Git repository on the host computer is synced with ``~/intranet`` on the vir
1414
## Set Up
1515

1616
1. Create your own fork of the [``tjcsl/ion`` repository](https://github.com/tjcsl/ion.git).
17-
2. Clone the Ion repositiory from your Ion fork by running ``git clone [email protected]:<YOUR_GITHUB_USERNAME>/ion.git intranet``. Note: if your host machine is running Windows, please run ``git config core.autocrlf input`` before cloning to prevent line ending issues.
17+
2. Clone the Ion repository from your Ion fork by running ``git clone [email protected]:<YOUR_GITHUB_USERNAME>/ion.git intranet``. Note: if your host machine is running Windows, please run ``git config core.autocrlf input`` before cloning to prevent line ending issues.
1818
3. Run ``cd config/docker``
1919
4. Run `docker compose build ` (or use `docker-compose build` if this doesn't work)
2020
5. Run ``docker compose up``
@@ -35,7 +35,7 @@ Navigate to http://localhost:8080 in the web browser of your choice. You might h
3535

3636
### Interacting with the application:
3737

38-
If you need to run a Django command like ``makemigrations``, ``collectstatic`` or ``shell_plus``, run ``docker exec -it intranet bash`` in your terminal. That wlll give you a shell into the application container. You can also use this to run scripts like ``build_sources.sh``. If you need to view the output from or restart ``runserver``, run ``docker attach application``.
38+
If you need to run a Django command like ``makemigrations``, ``collectstatic`` or ``shell_plus``, run ``docker exec -it intranet bash`` in your terminal. That will give you a shell into the application container. You can also use this to run scripts like ``build_sources.sh``. If you need to view the output from or restart ``runserver``, run ``docker attach application``.
3939

4040
### Attaching to logs
4141

@@ -45,14 +45,14 @@ To view logs of a container, run `docker logs [CONTAINER NAME] -f`. For example,
4545

4646
## Prerequisites
4747

48-
- [Virtualbox](https://www.virtualbox.org/) is a virtualization service that allows the creation of virtual machines. Installation is OS-specific and instructions can be found [here](https://www.virtualbox.org/wiki/Downloads).
48+
- [Virtualbox](https://www.virtualbox.org/) is a virtualization service that allows the creation of virtual machines. Installation is OS-specific and instructions can be found [here](https://www.virtualbox.org/wiki/Downloads).
4949
- [Vagrant](https://www.vagrantup.com/) is a command line utility for managing and setting up virtual machines and environments. Installation is OS-specific and instructions can be found [here](https://developer.hashicorp.com/vagrant/downloads).
5050
- [GitHub](https://github.com) is the version control system used by the CSL. Make sure that you have an account and an SSH key tied to that account that will allow you to push and pull code. Ensure you have an SSH key set up with GitHub by running ``ssh -T [email protected]``. You should be greeted by your username. If not, set up an SSH key with GitHub by following [these instructions](https://help.github.com/articles/generating-an-ssh-key/).
5151

5252
## Set Up
5353

5454
1. Create your own fork of the [``tjcsl/ion`` repository](https://github.com/tjcsl/ion.git).
55-
2. Clone the Ion repositiory from your Ion fork by running ``git clone [email protected]:<YOUR_GITHUB_USERNAME>/ion.git intranet``. Note: if your host machine is running Windows, please run ``git config core.autocrlf input`` before cloning to prevent line ending issues.
55+
2. Clone the Ion repository from your Ion fork by running ``git clone [email protected]:<YOUR_GITHUB_USERNAME>/ion.git intranet``. Note: if your host machine is running Windows, please run ``git config core.autocrlf input`` before cloning to prevent line ending issues.
5656
3. In the ``config/vagrant`` directory, copy the file ``devconfig.json.sample`` to ``devconfig.json`` and edit the properties in ``devconfig.json`` as appropriate. Ensure ``ssh_key`` is set to the same SSH key registered with GitHub (e.g. ``id_rsa``).
5757
4. Run ``vagrant plugin install vagrant-vbguest``. If you are on Windows, also run ``vagrant plugin install vagrant-winnfsd``.
5858
5. Run ``vagrant up && vagrant reload`` and wait while the development environment is set up. If you are asked to select a network interface for bridging, enter the number corresponding to one that is active. To automatically select this interface in the future, set the "network_interface" key in ``devconfig.json`` to the name of the interface you selected (e.g. ``"en0: Wi-Fi (AirPort)"``). There may be repeated warnings similar to "``Remote connection disconnect`` and ``Warning: Connection aborted. Retrying...`` on the second ``vagrant up``. After several minutes they will stop.
@@ -100,11 +100,11 @@ When you want to close the VM environment, make sure you have exited out of the
100100

101101
## Changing Master Password
102102

103-
The master password for vagrant development enviornment is ``swordfish``.
103+
The master password for vagrant development environment is ``swordfish``.
104104

105105
In non-Vagrant environments, you should set a master password different from the default. Ideally, this password should have many bits of entropy and should be randomly generated.
106106

107-
We use the secure Argon2 hashing algorithim to secure our master password. To set the master password, set ``MASTER_PASSWORD`` to the string output of the below script (after changing values as appropriate) in ``secret.py``. After changing this value, restart Ion.
107+
We use the secure Argon2 hashing algorithm to secure our master password. To set the master password, set ``MASTER_PASSWORD`` to the string output of the below script (after changing values as appropriate) in ``secret.py``. After changing this value, restart Ion.
108108

109109
Currently, Ion requires that you use Argon2id to create the hash. You also must prepend ``argon2`` to the hash before putting it into ``secret.py``.
110110

config/docker/entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
if [ ! -f "config/docker/first-run.log" ]; then
3+
if [ ! -f "config/docker/first-run.log" ]; then
44
echo "# Log of first run, to run initial setup again, delete this file" > config/docker/first-run.log
55
/bin/sh config/docker/initial_setup.sh 2>&1 | tee -a config/docker/first-run.log
66
fi
@@ -11,7 +11,7 @@ export PYTHONUNBUFFERED=1 # Don't buffer Django output
1111

1212
# Wrap the run command in a loop so that it restarts if it crashes, e.g. due to a syntax error
1313
while true
14-
do
14+
do
1515
python3 manage.py run 0.0.0.0:8080 # Custom run command that skips system checks for performance
1616
sleep 1
1717
done

config/docker/initial_setup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ echo -e "${BLUE}${BOLD}Copying over secret.py...${CLEAR}"
99
cp -u config/docker/secret.py intranet/settings
1010

1111
echo -e "${BLUE}${BOLD}Collecting static...${CLEAR}"
12-
python3 manage.py collectstatic --noinput
12+
python3 manage.py collectstatic --noinput
1313

1414
echo -e "${BLUE}${BOLD}Running migrations...${CLEAR}"
15-
python3 manage.py migrate
15+
python3 manage.py migrate
1616

1717
echo -e "${BLUE}${BOLD}Copying over scripts...${CLEAR}"
1818
cp config/scripts/*.py .
@@ -22,7 +22,7 @@ for year in "freshman" "sophomore" "junior" "senior"; do
2222
python3 create_users.py -t student -nw -y $year -n student student1 student2 student3 student4 student5
2323
python3 create_users.py -t admin -nw -y $year -n admin admin1 admin2 admin3 admin4 admin5
2424
done
25-
python3 create_users.py -nw -ny -t admin -n admin
25+
python3 create_users.py -nw -ny -t admin -n admin
2626
python3 create_users.py -t admin -c 10
2727
python3 create_users.py -t student -c 100
2828
python3 create_users.py -t teacher -c 20

config/scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A set of scripts to generate somewhat realistic student data for the Ion develop
88
- To run manually and/or change data:
99

1010
- Delete `config/docker/first-run.log`
11-
11+
1212
- Then, either:
1313
- Restart the container to load new data
1414
- Or manually run `config/docker/initial_setup.sh`

config/scripts/create_activities.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def generate_activities(args: argparse.Namespace) -> None:
3333
if restriction == "senior":
3434
activity.seniors_allowed = True
3535

36-
sponser = EighthSponsor.objects.get_or_create(user=random.choice(teachers))[0]
37-
sponser.save()
38-
activity.sponsors.set((sponser,))
36+
sponsor = EighthSponsor.objects.get_or_create(user=random.choice(teachers))[0]
37+
sponsor.save()
38+
activity.sponsors.set((sponsor,))
3939

4040
room = EighthRoom.objects.get_or_create(name=f"Room {random.randint(1, 100)}")[0]
4141
room.save()

config/scripts/create_users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def generate_names(args: argparse.Namespace) -> "list[tuple[str]]":
112112
def main() -> None:
113113
parser = argparse.ArgumentParser()
114114
parser.add_argument(
115-
"-n", "--names", nargs="+", default=[], help="Provide in format first_last, or as a username, ignores count if supplied, seperate with '_'"
115+
"-n", "--names", nargs="+", default=[], help="Provide in format first_last, or as a username, ignores count if supplied, separate with '_'"
116116
)
117117
parser.add_argument("-c", "--count", type=int, default=10, help="Number of users to make, defaults to 10")
118118
parser.add_argument("-t", "--type", type=str, required=True, choices=["student", "teacher", "admin"], help="type of user to make")

docs/developing/eighth-models.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ What follows is a brief list of the eighth models with a description of each. Mo
2121
The ``add_user()`` method of this class is where all of the logic to sign a user up for an activity is. Be *very* careful when modifying it.
2222

2323
- ``EighthSignup``: Represents that a user is signed up for a particular ``EighthScheduledActivity`` during the block for which it is scheduled. Has ``ForeignKey``\s to the ``EighthScheduledActivity`` and the ``User`` objects. Also stores some information such as whether the user signed up after the deadline (assumed to be a pass), whether the user signed themselves up or was signed up by an eighth admin, the name and sponsor list of the activity they were signed up for previously (if applicable), whether they were absent, etc.
24-
24+
2525
**Note**: Since Ion's launch, it has been plagued by duplicate ``EighthSignup``\s (``EighthSignup``\s for the same user during the same block) being created. There are multiple checks before the object is saved to make sure it is unique, and uniqueness is enforced on a per-user, per- ``EighthScheduledActivity`` basis at the model level, but the problem has continued. As of summer 2019, measures have been enacted that will hopefully minimize the occurrences of this issue in the future, as well as allow better diagnosing of the problem if it occurs again.
2626

2727
- ``EighthWaitlist``: Ion has all of the backend logic to implement waitlists for each activity, but it is not enabled in production (``settings.ENABLE_WAITLIST`` is ``False``). When the waitlist is enabled, an ``EighthWaitlist`` object represents that a user signed up for the waitlist for a particular ``EighthScheduledActivity`` at a particular time. The user's position in the waitlist is calculated dynamically by finding the number of users who signed up for the waitlist before them.

0 commit comments

Comments
 (0)