From 0cec14fec6c67128c7e29323a69ffdb4fbeaf263 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Thu, 8 Jul 2021 20:16:20 +0300 Subject: Create The Code Style Guide under Code Jam pages --- .../pages/code-jams/the-code-style-guide.html | 299 +++++++++++++++++++++ 1 file changed, 299 insertions(+) create mode 100644 pydis_site/templates/events/pages/code-jams/the-code-style-guide.html (limited to 'pydis_site') diff --git a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html new file mode 100644 index 00000000..33b36d99 --- /dev/null +++ b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html @@ -0,0 +1,299 @@ +{% extends "events/base_sidebar.html" %} + +{% block breadcrumb %} +
+ For end-users, the most important parts of the software are functionality and UI/UX. + But for developers, there is one more important aspect - code style. + While ugly code can do everything that it has to do, developing it further may be a difficult task, + especially if a developer didn't write an original code. + Which one of the following do you prefer to read and work with? +
+
+
+ MyPath = '/file.txt'
+ from pathlib import *
+ import os.path,sys
+ def check(p):
+ """Uses os.path.exist """
+ return os.path.exists(p)
+
+ def getF(
+ p):
+ """Not sure what this do, this just worked.
+ """
+ return Path(p
+ )
+ result=[check(MyPath),getF(MyPath)]
+
+
+ or
+
+
+ import os.path
+ from pathlib import Path
+
+ FILE_PATH = '/file.txt'
+
+
+ def check_file_exists(path: str) -> bool:
+ """Checks does file exists in path. Uses os.path.exists."""
+ return os.path.exists(path)
+
+
+ def get_path_object(path: str) -> Path:
+ """
+ Returns Path object of the path provided in arguments.
+
+ This is here for backward compatibility, will be removed in the future.
+ """
+ return Path(path)
+
+ result = [
+ check_file_exists(FILE_PATH),
+ get_path_object(FILE_PATH),
+ ]
+
+
+
+ + The second is definitely easier to read and understand. + These scripts are small and if you read even first, you can understand what this code does pretty fast, + but what if the project has thousands and thousands of files in a really complex folder structure? + Do you want then code what looks like the first example? + You can save hours sometimes if you write beautiful code that follows style rules. +
++ The most important document of Python code style is PEP 8. + This gives the majority of all Python code style rules. This article will cover the most important rules of PEP 8. +
+ ++ But everyone makes mistakes and there are so many style rules that can be really difficult to remember and always follow. + Luckily, we have amazing tools that help us - linters. While there are many linters, + we'd like code jam participants to use flake8. + Flake8 points out to you rules what you did break in your code so you can fix them. +
+ +For indentation, you should use 4 spaces. Using tabs is not suggested, but if you do, you can't mix spaces and tabs.
++ PEP 8 defines a maximum line length of 79 characters, however, + we are not so strict - we let teams choose a maximum line length between 79 and 119 characters. +
+2 blank lines should be left before functions and classes. Single blank lines are used to split sections and make logical breaks.
+ +Module, file, function, and variable names (except type variables) should be lowercase and use underscores.
+
+
+ # File: my_module.py/mymodule.py
+
+ def my_function():
+ my_variable = "value"
+
+
+ Class and type variable names should use the camel case style.
+
+
+ from typing import List
+
+
+ class MyClass:
+ pass
+
+ ListOfMyClass = List[MyClass]
+
+
+ Constant names should be all uppercase, and words should be separated with underscores.
+
+
+ MY_CONSTANT = 1
+
+
+ + You should avoid single-character names, as these might be confusing. + But if you still do, you should avoid characters that may look like zero or one in some fonts: + "O" (uppercase o), "l" (lowercase L), and "I" (uppercase i). +
+ ++ If you have a chain of mathematic operations that you split into multiple lines, + you should put the operator at the beginning of the line and not to the end of the line. +
+
+
+ # No
+ result = (
+ 1 +
+ 2 *
+ 3
+ )
+
+ # Yes
+ result = (
+ 1
+ + 2
+ * 3
+ )
+
+
+ If you compare against None, you should use is and is not, but not compare equality.
+
+ # No
+ if variable == None:
+ print("Variable is None")
+
+ # Yes
+ if variable is None:
+ print("Variable is None")
+
+
+
+ You should prefer using over not .
+ Using second makes it harder to understand the expression.
+
+
+ # No
+ if not variable is None:
+ print("Variable is not None")
+
+ # Yes - it is much easier to read and understand this than previous
+ if variable is not None:
+ print("Variable is not None")
+
+
+
+ Imports should be at top of the file, the only things that should be before them are module comments and docstrings.
+You shouldn't import multiple modules in one line, but give each module import its own line instead.
+
+
+ # No
+ import pathlib, os
+
+ # Yes
+ import os
+ import pathlib
+
+
+ Wildcard imports should be avoided in most cases. They make unclear where what comes from.
+
+
+ # No
+ from pathlib import *
+
+ # Yes
+ from pathlib import Path
+
+
+ You should use isort imports order specification, what means:
+__future__ imports, standard library imports,
+ third-party library imports, and finally project imports.
+ import <package>
+ and after them from <package> import <items>.
+ from <package> import <items> format,
+ <items> should be ordered alphabetically, starting with bare module imports.
+ + Comments are really important because they help everyone understand, what code does. + But as important as having comments is keeping them up-to-date. + Out-to-date, wrong comments confuse readers. +
+Comments content should start with a capital letter and be a full sentence(s).
+There are three types of comments:
+# what should be followed by a single space,
+ except for text indention inside the comment. To separate paragraphs, use one line containing only #.
+
+
+ if variable is None or variable == 1:
+ # If variable is None, something went wrong previously.
+ #
+ # Here starts a new important paragraph.
+
+
+ # what should be followed by a single space.
+
+
+ # Do not use inline comments to explain things
+ # that the reader can understand even without the inline comment.
+ my_variable = "Value!" # Assign value to my_variable
+
+ # Here better variable name can be used like shown in the second line.
+ x = "Walmart" # Shop name
+ shop_name = "Walmart"
+
+ # Sometimes, if something is not obvious, then inline comments are useful.
+ # Example is from PEP 8.
+ x = x + 1 # Compensate for border
+
+
+
+
+ # This is a one-line docstring.
+ """This is one line module docstring."""
+
+
+ # This is a multiline docstring.
+ def my_function():
+ """
+ This is the summary line.
+
+ This is the description.
+ """
+
+
+ + Is all this PEP 8 rules stuff making your head exploding? We have something for you! We have a song! + We have The PEP 8 Song (featuring lemonsaurus)! + Great way to get started with writing beautiful code. +
+{% endblock %} + +{% block sidebar %} + {% include "events/sidebar/code-jams/useful-information.html" %} +{% endblock %} -- cgit v1.2.3 From 20ae1ecf415f19f422df4866a2e07359549460b2 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Thu, 8 Jul 2021 20:17:58 +0300 Subject: Add The Code Style Guide to useful information sidebar --- pydis_site/templates/events/sidebar/code-jams/useful-information.html | 1 + 1 file changed, 1 insertion(+) (limited to 'pydis_site') diff --git a/pydis_site/templates/events/sidebar/code-jams/useful-information.html b/pydis_site/templates/events/sidebar/code-jams/useful-information.html index c4e665e6..841a533a 100644 --- a/pydis_site/templates/events/sidebar/code-jams/useful-information.html +++ b/pydis_site/templates/events/sidebar/code-jams/useful-information.html @@ -4,5 +4,6 @@Imports should be at top of the file, the only things that should be before them are module comments and docstrings.
You shouldn't import multiple modules in one line, but give each module import its own line instead.
-- cgit v1.2.3 From 23b1e46342e743cdb1ec8e0bb30e4696a3018079 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Fri, 9 Jul 2021 00:00:15 +0300 Subject: Add missing slash at b tag ending Co-authored-by: Numerlor <25886452+Numerlor@users.noreply.github.com> --- pydis_site/templates/events/pages/code-jams/the-code-style-guide.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html index 3176babf..eb8ab9da 100644 --- a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html +++ b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html @@ -199,7 +199,7 @@ from pathlib import Path -You should use isort imports order specification, what means:
+You should use isort imports order specification, what means:
__future__ imports, standard library imports,
--
cgit v1.2.3
From 1ff45d2831eff3a48bd7718bb95b9e73d513713e Mon Sep 17 00:00:00 2001
From: ks129 <45097959+ks129@users.noreply.github.com>
Date: Fri, 9 Jul 2021 00:03:04 +0300
Subject: Use better wording for head explosion question
---
pydis_site/templates/events/pages/code-jams/the-code-style-guide.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'pydis_site')
diff --git a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html
index eb8ab9da..be022ffc 100644
--- a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html
+++ b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html
@@ -288,7 +288,7 @@
- Is all this PEP 8 rules stuff making your head exploding? We have something for you! We have a song! + Do all these style rules make your head explode? We have something for you! We have a song! We have The PEP 8 Song (featuring lemonsaurus)! Great way to get started with writing beautiful code.
-- cgit v1.2.3 From c1ad8468166ae7bc37d7293b7ad724a329b9f8a2 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Fri, 9 Jul 2021 00:06:25 +0300 Subject: Add missing comma Co-authored-by: Numerlor <25886452+Numerlor@users.noreply.github.com> --- pydis_site/templates/events/pages/code-jams/the-code-style-guide.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html index be022ffc..07823f6f 100644 --- a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html +++ b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html @@ -220,7 +220,7 @@- Comments are really important because they help everyone understand, what code does. + Comments are really important because they help everyone understand what code does. But as important as having comments is keeping them up-to-date. Out-to-date, wrong comments confuse readers.
-- cgit v1.2.3 From 7f8e84b97ec38546bc6e1204f9fa1313955ad68d Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Fri, 9 Jul 2021 00:08:18 +0300 Subject: Way -> method --- pydis_site/templates/events/pages/code-jams/the-code-style-guide.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html index 07823f6f..fabf5444 100644 --- a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html +++ b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html @@ -206,11 +206,11 @@ third-party library imports, and finally project imports.import <package>
+ Group by import method: inside each group, first should come imports in format import <package>
and after them from <package> import <items>.
from <package> import <items> format,
--
cgit v1.2.3
From 761aa067d19f669e56c32dc4c24b8242cd23a668 Mon Sep 17 00:00:00 2001
From: ks129 <45097959+ks129@users.noreply.github.com>
Date: Fri, 9 Jul 2021 00:09:32 +0300
Subject: Add missing colon
Co-authored-by: Numerlor <25886452+Numerlor@users.noreply.github.com>
---
pydis_site/templates/events/pages/code-jams/the-code-style-guide.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'pydis_site')
diff --git a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html
index fabf5444..5e4a957e 100644
--- a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html
+++ b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html
@@ -202,7 +202,7 @@
You should use isort imports order specification, what means:
__future__ imports, standard library imports,
+ Group by type: order of import types should be: __future__ imports, standard library imports,
third-party library imports, and finally project imports.
# what should be followed by a single space.
+ Just like block comments, inline comments also have to start with # followed by a single space.
# Do not use inline comments to explain things
@@ -267,7 +267,7 @@
Docstrings should start and end with three quotes ("""). There are two types of docstrings: one-line docstrings and multiline docstrings.
One-line docstrings have to start and end in the same line, while multiline docstrings start and end in different lines.
Multiline docstring has two parts: summary line and a longer description, which are separated by one empty line.
- The multiline sentence starting and ending quotes should be at different lines than the content.
+ The multiline sentence start and end quotes should be at different lines than the content.
# This is a one-line docstring.
--
cgit v1.2.3
From bdc492f79880b3ebb7be6e15020142e44c8dbdd6 Mon Sep 17 00:00:00 2001
From: ks129 <45097959+ks129@users.noreply.github.com>
Date: Fri, 9 Jul 2021 00:12:35 +0300
Subject: Escape HTML in The Code Style Guide
---
pydis_site/templates/events/pages/code-jams/the-code-style-guide.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'pydis_site')
diff --git a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html
index a26a973c..4258cd94 100644
--- a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html
+++ b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html
@@ -161,7 +161,7 @@
- You should prefer using - is not
over not - is
.
+ You should prefer using <item one> is not <item two> over not <item one> is <item two>.
Using second makes it harder to understand the expression.
--
cgit v1.2.3
From dea0924f8160c5452e0c52657aeaacc488b606e2 Mon Sep 17 00:00:00 2001
From: ks129 <45097959+ks129@users.noreply.github.com>
Date: Fri, 9 Jul 2021 00:26:58 +0300
Subject: Remove leading spaces and unnecessary newlines from code blocks
HTML tag is adding indention also to result, so I had to remove these.
---
.../pages/code-jams/the-code-style-guide.html | 252 ++++++++-------------
1 file changed, 100 insertions(+), 152 deletions(-)
(limited to 'pydis_site')
diff --git a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html
index 4258cd94..d3359ebb 100644
--- a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html
+++ b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html
@@ -16,52 +16,44 @@
especially if a developer didn't write an original code.
Which one of the following do you prefer to read and work with?
-
-
- MyPath = '/file.txt'
- from pathlib import *
- import os.path,sys
- def check(p):
- """Uses os.path.exist """
- return os.path.exists(p)
-
- def getF(
- p):
- """Not sure what this do, this just worked.
- """
- return Path(p
- )
- result=[check(MyPath),getF(MyPath)]
-
-
+ MyPath = '/file.txt'
+from pathlib import *
+import os.path,sys
+def check(p):
+ """Uses os.path.exist """
+ return os.path.exists(p)
+
+def getF(
+ p):
+ """Not sure what this do, this just worked.
+ """
+ return Path(p
+ )
+result=[check(MyPath),getF(MyPath)]
or
-
-
- import os.path
- from pathlib import Path
+ import os.path
+from pathlib import Path
- FILE_PATH = '/file.txt'
+FILE_PATH = '/file.txt'
- def check_file_exists(path: str) -> bool:
- """Checks does file exists in path. Uses os.path.exists."""
- return os.path.exists(path)
+def check_file_exists(path: str) -> bool:
+ """Checks does file exists in path. Uses os.path.exists."""
+ return os.path.exists(path)
- def get_path_object(path: str) -> Path:
- """
- Returns Path object of the path provided in arguments.
+def get_path_object(path: str) -> Path:
+ """
+ Returns Path object of the path provided in arguments.
- This is here for backward compatibility, will be removed in the future.
- """
- return Path(path)
+ This is here for backward compatibility, will be removed in the future.
+ """
+ return Path(path)
- result = [
- check_file_exists(FILE_PATH),
- get_path_object(FILE_PATH),
- ]
-
-
+result = [
+ check_file_exists(FILE_PATH),
+ get_path_object(FILE_PATH),
+]
The second is definitely easier to read and understand.
@@ -94,32 +86,20 @@
Naming
Module, file, function, and variable names (except type variables) should be lowercase and use underscores.
-
-
- # File: my_module.py/mymodule.py
-
- def my_function():
- my_variable = "value"
-
-
+ # File: my_module.py/mymodule.py
+
+def my_function():
+ my_variable = "value"
Class and type variable names should use the camel case style.
-
-
- from typing import List
+ from typing import List
- class MyClass:
- pass
+class MyClass:
+ pass
- ListOfMyClass = List[MyClass]
-
-
+ListOfMyClass = List[MyClass]
Constant names should be all uppercase, and words should be separated with underscores.
-
-
- MY_CONSTANT = 1
-
-
+ MY_CONSTANT = 1
You should avoid single-character names, as these might be confusing.
But if you still do, you should avoid characters that may look like zero or one in some fonts:
@@ -131,74 +111,54 @@
If you have a chain of mathematic operations that you split into multiple lines,
you should put the operator at the beginning of the line and not to the end of the line.
-
-
- # No
- result = (
- 1 +
- 2 *
- 3
- )
-
- # Yes
- result = (
- 1
- + 2
- * 3
- )
-
-
+ # No
+result = (
+ 1 +
+ 2 *
+ 3
+)
+
+# Yes
+result = (
+ 1
+ + 2
+ * 3
+)
If you compare against None, you should use is and is not, but not compare equality.
-
-
- # No
- if variable == None:
- print("Variable is None")
-
- # Yes
- if variable is None:
- print("Variable is None")
-
-
+ # No
+if variable == None:
+ print("Variable is None")
+
+# Yes
+if variable is None:
+ print("Variable is None")
You should prefer using <item one> is not <item two> over not <item one> is <item two>.
Using second makes it harder to understand the expression.
-
-
- # No
- if not variable is None:
- print("Variable is not None")
-
- # Yes - it is much easier to read and understand this than previous
- if variable is not None:
- print("Variable is not None")
-
-
+ # No
+if not variable is None:
+ print("Variable is not None")
+
+# Yes - it is much easier to read and understand this than previous
+if variable is not None:
+ print("Variable is not None")
Imports
Imports should be at top of the file, the only things that should be before them are module comments and docstrings.
You shouldn't import multiple modules in one line, but give each module import its own line instead.
-
-
- # No
- import pathlib, os
-
- # Yes
- import os
- import pathlib
-
-
+ # No
+import pathlib, os
+
+# Yes
+import os
+import pathlib
Wildcard imports should be avoided in most cases. They make unclear where what comes from.
-
-
- # No
- from pathlib import *
-
- # Yes
- from pathlib import Path
-
-
+ # No
+from pathlib import *
+
+# Yes
+from pathlib import Path
You should use isort imports order specification, what means:
-
@@ -231,35 +191,27 @@
Block comments: Probably most common comment type. Should be indented to the same level as the code they describe.
Each line in the block comment has to start with
# what should be followed by a single space,
except for text indention inside the comment. To separate paragraphs, use one line containing only #.
-
-
- if variable is None or variable == 1:
- # If variable is None, something went wrong previously.
- #
- # Here starts a new important paragraph.
-
-
+ if variable is None or variable == 1:
+ # If variable is None, something went wrong previously.
+ #
+ # Here starts a new important paragraph.
-
Inline comments: You should prefer block comments over inline comments and use inline comments only where it is really necessary.
Never use inline comments to explain obvious things like what a line does. If you want to use an inline comment on a variable, think first,
maybe you can use a better variable name instead. After code and before the start of inline comments should be at least two spaces.
Just like block comments, inline comments also have to start with
# followed by a single space.
-
-
- # Do not use inline comments to explain things
- # that the reader can understand even without the inline comment.
- my_variable = "Value!" # Assign value to my_variable
-
- # Here better variable name can be used like shown in the second line.
- x = "Walmart" # Shop name
- shop_name = "Walmart"
-
- # Sometimes, if something is not obvious, then inline comments are useful.
- # Example is from PEP 8.
- x = x + 1 # Compensate for border
-
-
+ # Do not use inline comments to explain things
+# that the reader can understand even without the inline comment.
+my_variable = "Value!" # Assign value to my_variable
+
+# Here better variable name can be used like shown in the second line.
+x = "Walmart" # Shop name
+shop_name = "Walmart"
+
+# Sometimes, if something is not obvious, then inline comments are useful.
+# Example is from PEP 8.
+x = x + 1 # Compensate for border
-
Docstrings: Last, but not least important comment type is docstring, which is a short version of documentation string.
@@ -268,21 +220,17 @@
One-line docstrings have to start and end in the same line, while multiline docstrings start and end in different lines.
Multiline docstring has two parts: summary line and a longer description, which are separated by one empty line.
The multiline sentence start and end quotes should be at different lines than the content.
-
-
- # This is a one-line docstring.
- """This is one line module docstring."""
+ # This is a one-line docstring.
+"""This is one line module docstring."""
- # This is a multiline docstring.
- def my_function():
- """
- This is the summary line.
+# This is a multiline docstring.
+def my_function():
+ """
+ This is the summary line.
- This is the description.
- """
-
-
+ This is the description.
+ """
--
cgit v1.2.3
From 20962cbc7ae5b3d0a5ba53e6d3360a02e07e750c Mon Sep 17 00:00:00 2001
From: ks129 <45097959+ks129@users.noreply.github.com>
Date: Fri, 9 Jul 2021 00:31:39 +0300
Subject: Split comments paragraphs to even smaller paragraphs
---
.../pages/code-jams/the-code-style-guide.html | 30 ++++++++++++++--------
1 file changed, 20 insertions(+), 10 deletions(-)
(limited to 'pydis_site')
diff --git a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html
index d3359ebb..68423dde 100644
--- a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html
+++ b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html
@@ -197,10 +197,15 @@ from pathlib import Path
# Here starts a new important paragraph.
# followed by a single space.
+ + Inline comments: You should prefer block comments over inline comments and use inline comments only where it is really necessary. + Never use inline comments to explain obvious things like what a line does. +
+If you want to use an inline comment on a variable, think first, maybe you can use a better variable name instead.
+
+ After code and before the start of inline comments should be at least two spaces.
+ Just like block comments, inline comments also have to start with # followed by a single space.
+
# Do not use inline comments to explain things
# that the reader can understand even without the inline comment.
my_variable = "Value!" # Assign value to my_variable
@@ -214,12 +219,17 @@ shop_name = "Walmart"
x = x + 1 # Compensate for border
+ Docstrings: Last, but not least important comment type is docstring, which is a short version of documentation string. + Docstring rules haven't been defined by PEP 8, but by PEP 257 instead. + Docstrings should start and end with three quotes ("""). +
+There are two types of docstrings: one-line docstrings and multiline docstrings.
++ One-line docstrings have to start and end in the same line, while multiline docstrings start and end in different lines. + Multiline docstring has two parts: summary line and a longer description, which are separated by one empty line. + The multiline docstring start and end quotes should be at different lines than the content. +
# This is a one-line docstring.
"""This is one line module docstring."""
--
cgit v1.2.3
From 944343cddc573d757784027463242298511ebf6a Mon Sep 17 00:00:00 2001
From: Janine vN
Date: Thu, 8 Jul 2021 18:57:13 -0400
Subject: Update dates & times for code jam The dates and times on the main
event page have been updated to reflect the changes.
---
pydis_site/templates/events/pages/code-jams/8/_index.html | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
(limited to 'pydis_site')
diff --git a/pydis_site/templates/events/pages/code-jams/8/_index.html b/pydis_site/templates/events/pages/code-jams/8/_index.html
index c510c250..34171969 100644
--- a/pydis_site/templates/events/pages/code-jams/8/_index.html
+++ b/pydis_site/templates/events/pages/code-jams/8/_index.html
@@ -12,12 +12,12 @@
{% block event_content %}
Twice a year we host a code jam for members of our server to participate in. The code jam is an event where we place you
- in a team with 5 other random server members. You then have 7 days to code some sort of application or program in Python.
+ in a team with 5 other random server members. You then have 8 days to code some sort of application or program in Python.
Your program must use the specified technology/framework and incorporate the theme chosen by the server.
- After the 7 days is complete, your team has 2 days to finish documentation and create a video presentation showcasing
- and walking through the program that your team has created. More details and specifics of this will be released within the next 2 weeks.
+ After the 8 days is complete, your team has 3 days to finish documentation and create a video presentation showcasing
+ and walking through the program that your team has created.
Important Dates
@@ -26,10 +26,10 @@
- Monday, June 21 - The Qualifier is released
- Friday, June 25 - Voting for the theme opens
- Saturday, June 26 @ 4PM UTC- GitHub Bootcamp
- - Wednesday, June 30 - The Qualifier closes
- - Friday, July 9 - Code Jam begins
- - Friday, July 16 - Coding portion of the jam ends
- - Sunday, July 18 - Code Jam submissions are closed
+ - Wednesday, July 1 - The Qualifier closes
+ - Friday, July 9 @ 5PM UTC - Code Jam begins and the theme is announced
+ - Saturday, July 17 @ 5PM UTC - Coding portion of the jam ends
+ - Tuesday, July 20 - Code Jam submissions are closed and video presentation must be submitted
+ For end-users, the most important parts of the software are functionality and UI/UX. + But for developers, there is one more important aspect - code style. + While ugly code can do everything that it has to do, developing it further may be a difficult task, + especially if a developer didn't write an original code. + Which one of the following do you prefer to read and work with? +
+MyPath = '/file.txt'
+from pathlib import *
+import os.path,sys
+def check(p):
+ """Uses os.path.exist """
+ return os.path.exists(p)
+
+def getF(
+ p):
+ """Not sure what this do, this just worked.
+ """
+ return Path(p
+ )
+result=[check(MyPath),getF(MyPath)]
+ or
+import os.path
+from pathlib import Path
+
+FILE_PATH = '/file.txt'
+
+
+def check_file_exists(path: str) -> bool:
+ """Checks does file exists in path. Uses os.path.exists."""
+ return os.path.exists(path)
+
+
+def get_path_object(path: str) -> Path:
+ """
+ Returns Path object of the path provided in arguments.
+
+ This is here for backward compatibility, will be removed in the future.
+ """
+ return Path(path)
+
+result = [
+ check_file_exists(FILE_PATH),
+ get_path_object(FILE_PATH),
+]
+
+ + The second is definitely easier to read and understand. + These scripts are small and if you read even first, you can understand what this code does pretty fast, + but what if the project has thousands and thousands of files in a really complex folder structure? + Do you want then code what looks like the first example? + You can save hours sometimes if you write beautiful code that follows style rules. +
++ The most important document of Python code style is PEP 8. + This gives the majority of all Python code style rules. This article will cover the most important rules of PEP 8. +
+ ++ But everyone makes mistakes and there are so many style rules that can be really difficult to remember and always follow. + Luckily, we have amazing tools that help us - linters. While there are many linters, + we'd like code jam participants to use flake8. + Flake8 points out to you rules what you did break in your code so you can fix them. +
+ +For indentation, you should use 4 spaces. Using tabs is not suggested, but if you do, you can't mix spaces and tabs.
++ PEP 8 defines a maximum line length of 79 characters, however, + we are not so strict - we let teams choose a maximum line length between 79 and 119 characters. +
+2 blank lines should be left before functions and classes. Single blank lines are used to split sections and make logical breaks.
+ +Module, file, function, and variable names (except type variables) should be lowercase and use underscores.
+# File: my_module.py/mymodule.py
+
+def my_function():
+ my_variable = "value"
+ Class and type variable names should use the camel case style.
+from typing import List
+
+
+class MyClass:
+ pass
+
+ListOfMyClass = List[MyClass]
+ Constant names should be all uppercase, and words should be separated with underscores.
+MY_CONSTANT = 1
+ + You should avoid single-character names, as these might be confusing. + But if you still do, you should avoid characters that may look like zero or one in some fonts: + "O" (uppercase o), "l" (lowercase L), and "I" (uppercase i). +
+ ++ If you have a chain of mathematic operations that you split into multiple lines, + you should put the operator at the beginning of the line and not to the end of the line. +
+# No
+result = (
+ 1 +
+ 2 *
+ 3
+)
+
+# Yes
+result = (
+ 1
+ + 2
+ * 3
+)
+ If you compare against None, you should use is and is not, but not compare equality.
# No
+if variable == None:
+ print("Variable is None")
+
+# Yes
+if variable is None:
+ print("Variable is None")
+
+ You should prefer using <item one> is not <item two> over not <item one> is <item two>.
+ Using second makes it harder to understand the expression.
+
# No
+if not variable is None:
+ print("Variable is not None")
+
+# Yes - it is much easier to read and understand this than previous
+if variable is not None:
+ print("Variable is not None")
+
+ Imports should be at top of the file, the only things that should be before them are module comments and docstrings.
+You shouldn't import multiple modules in one line, but give each module import its own line instead.
+# No
+import pathlib, os
+
+# Yes
+import os
+import pathlib
+ Wildcard imports should be avoided in most cases. They make unclear where what comes from.
+# No
+from pathlib import *
+
+# Yes
+from pathlib import Path
+ You should use isort imports order specification, what means:
+__future__ imports, standard library imports,
+ third-party library imports, and finally project imports.
+ import <package>
+ and after them from <package> import <items>.
+ from <package> import <items> format,
+ <items> should be ordered alphabetically, starting with bare module imports.
+ + Comments are really important because they help everyone understand what code does. + But as important as having comments is keeping them up-to-date. + Out-to-date, wrong comments confuse readers. +
+Comments content should start with a capital letter and be a full sentence(s).
+There are three types of comments:
+# what should be followed by a single space,
+ except for text indention inside the comment. To separate paragraphs, use one line containing only #.
+ if variable is None or variable == 1:
+ # If variable is None, something went wrong previously.
+ #
+ # Here starts a new important paragraph.
+ + Inline comments: You should prefer block comments over inline comments and use inline comments only where it is really necessary. + Never use inline comments to explain obvious things like what a line does. +
+If you want to use an inline comment on a variable, think first, maybe you can use a better variable name instead.
+
+ After code and before the start of inline comments should be at least two spaces.
+ Just like block comments, inline comments also have to start with # followed by a single space.
+
# Do not use inline comments to explain things
+# that the reader can understand even without the inline comment.
+my_variable = "Value!" # Assign value to my_variable
+
+# Here better variable name can be used like shown in the second line.
+x = "Walmart" # Shop name
+shop_name = "Walmart"
+
+# Sometimes, if something is not obvious, then inline comments are useful.
+# Example is from PEP 8.
+x = x + 1 # Compensate for border
+ + Docstrings: Last, but not least important comment type is docstring, which is a short version of documentation string. + Docstring rules haven't been defined by PEP 8, but by PEP 257 instead. + Docstrings should start and end with three quotes ("""). +
+There are two types of docstrings: one-line docstrings and multiline docstrings.
++ One-line docstrings have to start and end in the same line, while multiline docstrings start and end in different lines. + Multiline docstring has two parts: summary line and a longer description, which are separated by one empty line. + The multiline docstring start and end quotes should be at different lines than the content. +
+# This is a one-line docstring.
+"""This is one line module docstring."""
+
+
+# This is a multiline docstring.
+def my_function():
+ """
+ This is the summary line.
+
+ This is the description.
+ """
+ + Do all these style rules make your head explode? We have something for you! We have a song! + We have The PEP 8 Song (featuring lemonsaurus)! + Great way to get started with writing beautiful code. +
+{% endblock %} + +{% block sidebar %} + {% include "events/sidebar/code-jams/useful-information.html" %} +{% endblock %} diff --git a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html b/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html deleted file mode 100644 index 68423dde..00000000 --- a/pydis_site/templates/events/pages/code-jams/the-code-style-guide.html +++ /dev/null @@ -1,257 +0,0 @@ -{% extends "events/base_sidebar.html" %} - -{% block breadcrumb %} -- For end-users, the most important parts of the software are functionality and UI/UX. - But for developers, there is one more important aspect - code style. - While ugly code can do everything that it has to do, developing it further may be a difficult task, - especially if a developer didn't write an original code. - Which one of the following do you prefer to read and work with? -
-MyPath = '/file.txt'
-from pathlib import *
-import os.path,sys
-def check(p):
- """Uses os.path.exist """
- return os.path.exists(p)
-
-def getF(
- p):
- """Not sure what this do, this just worked.
- """
- return Path(p
- )
-result=[check(MyPath),getF(MyPath)]
- or
-import os.path
-from pathlib import Path
-
-FILE_PATH = '/file.txt'
-
-
-def check_file_exists(path: str) -> bool:
- """Checks does file exists in path. Uses os.path.exists."""
- return os.path.exists(path)
-
-
-def get_path_object(path: str) -> Path:
- """
- Returns Path object of the path provided in arguments.
-
- This is here for backward compatibility, will be removed in the future.
- """
- return Path(path)
-
-result = [
- check_file_exists(FILE_PATH),
- get_path_object(FILE_PATH),
-]
-
- - The second is definitely easier to read and understand. - These scripts are small and if you read even first, you can understand what this code does pretty fast, - but what if the project has thousands and thousands of files in a really complex folder structure? - Do you want then code what looks like the first example? - You can save hours sometimes if you write beautiful code that follows style rules. -
-- The most important document of Python code style is PEP 8. - This gives the majority of all Python code style rules. This article will cover the most important rules of PEP 8. -
- -- But everyone makes mistakes and there are so many style rules that can be really difficult to remember and always follow. - Luckily, we have amazing tools that help us - linters. While there are many linters, - we'd like code jam participants to use flake8. - Flake8 points out to you rules what you did break in your code so you can fix them. -
- -For indentation, you should use 4 spaces. Using tabs is not suggested, but if you do, you can't mix spaces and tabs.
-- PEP 8 defines a maximum line length of 79 characters, however, - we are not so strict - we let teams choose a maximum line length between 79 and 119 characters. -
-2 blank lines should be left before functions and classes. Single blank lines are used to split sections and make logical breaks.
- -Module, file, function, and variable names (except type variables) should be lowercase and use underscores.
-# File: my_module.py/mymodule.py
-
-def my_function():
- my_variable = "value"
- Class and type variable names should use the camel case style.
-from typing import List
-
-
-class MyClass:
- pass
-
-ListOfMyClass = List[MyClass]
- Constant names should be all uppercase, and words should be separated with underscores.
-MY_CONSTANT = 1
- - You should avoid single-character names, as these might be confusing. - But if you still do, you should avoid characters that may look like zero or one in some fonts: - "O" (uppercase o), "l" (lowercase L), and "I" (uppercase i). -
- -- If you have a chain of mathematic operations that you split into multiple lines, - you should put the operator at the beginning of the line and not to the end of the line. -
-# No
-result = (
- 1 +
- 2 *
- 3
-)
-
-# Yes
-result = (
- 1
- + 2
- * 3
-)
- If you compare against None, you should use is and is not, but not compare equality.
# No
-if variable == None:
- print("Variable is None")
-
-# Yes
-if variable is None:
- print("Variable is None")
-
- You should prefer using <item one> is not <item two> over not <item one> is <item two>.
- Using second makes it harder to understand the expression.
-
# No
-if not variable is None:
- print("Variable is not None")
-
-# Yes - it is much easier to read and understand this than previous
-if variable is not None:
- print("Variable is not None")
-
- Imports should be at top of the file, the only things that should be before them are module comments and docstrings.
-You shouldn't import multiple modules in one line, but give each module import its own line instead.
-# No
-import pathlib, os
-
-# Yes
-import os
-import pathlib
- Wildcard imports should be avoided in most cases. They make unclear where what comes from.
-# No
-from pathlib import *
-
-# Yes
-from pathlib import Path
- You should use isort imports order specification, what means:
-__future__ imports, standard library imports,
- third-party library imports, and finally project imports.
- import <package>
- and after them from <package> import <items>.
- from <package> import <items> format,
- <items> should be ordered alphabetically, starting with bare module imports.
- - Comments are really important because they help everyone understand what code does. - But as important as having comments is keeping them up-to-date. - Out-to-date, wrong comments confuse readers. -
-Comments content should start with a capital letter and be a full sentence(s).
-There are three types of comments:
-# what should be followed by a single space,
- except for text indention inside the comment. To separate paragraphs, use one line containing only #.
- if variable is None or variable == 1:
- # If variable is None, something went wrong previously.
- #
- # Here starts a new important paragraph.
- - Inline comments: You should prefer block comments over inline comments and use inline comments only where it is really necessary. - Never use inline comments to explain obvious things like what a line does. -
-If you want to use an inline comment on a variable, think first, maybe you can use a better variable name instead.
-
- After code and before the start of inline comments should be at least two spaces.
- Just like block comments, inline comments also have to start with # followed by a single space.
-
# Do not use inline comments to explain things
-# that the reader can understand even without the inline comment.
-my_variable = "Value!" # Assign value to my_variable
-
-# Here better variable name can be used like shown in the second line.
-x = "Walmart" # Shop name
-shop_name = "Walmart"
-
-# Sometimes, if something is not obvious, then inline comments are useful.
-# Example is from PEP 8.
-x = x + 1 # Compensate for border
- - Docstrings: Last, but not least important comment type is docstring, which is a short version of documentation string. - Docstring rules haven't been defined by PEP 8, but by PEP 257 instead. - Docstrings should start and end with three quotes ("""). -
-There are two types of docstrings: one-line docstrings and multiline docstrings.
-- One-line docstrings have to start and end in the same line, while multiline docstrings start and end in different lines. - Multiline docstring has two parts: summary line and a longer description, which are separated by one empty line. - The multiline docstring start and end quotes should be at different lines than the content. -
-# This is a one-line docstring.
-"""This is one line module docstring."""
-
-
-# This is a multiline docstring.
-def my_function():
- """
- This is the summary line.
-
- This is the description.
- """
- - Do all these style rules make your head explode? We have something for you! We have a song! - We have The PEP 8 Song (featuring lemonsaurus)! - Great way to get started with writing beautiful code. -
-{% endblock %} - -{% block sidebar %} - {% include "events/sidebar/code-jams/useful-information.html" %} -{% endblock %} -- cgit v1.2.3 From da5ba59bbe2172e7a672bdb3308427315e6ceba4 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Fri, 9 Jul 2021 12:18:19 +0300 Subject: Drop the- prefix from CJ 8 sidebar code style guide item --- pydis_site/templates/events/sidebar/code-jams/8.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/events/sidebar/code-jams/8.html b/pydis_site/templates/events/sidebar/code-jams/8.html index e68c913d..de8c6b0b 100644 --- a/pydis_site/templates/events/sidebar/code-jams/8.html +++ b/pydis_site/templates/events/sidebar/code-jams/8.html @@ -4,7 +4,7 @@ Rules Approved Frameworks GitHub Bootcamp - The Code Style Guide + The Code Style GuideThere are three types of comments:
# what should be followed by a single space,
- except for text indention inside the comment. To separate paragraphs, use one line containing only #.
+
+ Probably most common comment type. Should be indented to the same level as the code they describe.
+ Each line in the block comment has to start with # what should be followed by a single space,
+ except for text indention inside the comment. To separate paragraphs, use one line containing only #.
+
if variable is None or variable == 1:
# If variable is None, something went wrong previously.
#
# Here starts a new important paragraph.
- Inline comments: You should prefer block comments over inline comments and use inline comments only where it is really necessary. + You should prefer block comments over inline comments and use inline comments only where it is really necessary. Never use inline comments to explain obvious things like what a line does.
If you want to use an inline comment on a variable, think first, maybe you can use a better variable name instead.
@@ -219,8 +223,9 @@ shop_name = "Walmart" x = x + 1 # Compensate for border- Docstrings: Last, but not least important comment type is docstring, which is a short version of documentation string. + Last, but not least important comment type is docstring, which is a short version of documentation string. Docstring rules haven't been defined by PEP 8, but by PEP 257 instead. Docstrings should start and end with three quotes (""").
-- cgit v1.2.3 From 3f1db69bea7a87073b1f58d7dac3e62fcb6438e8 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Fri, 9 Jul 2021 15:01:04 +0300 Subject: List comment types beforeComments content should start with a capital letter and be a full sentence(s).
-There are three types of comments:
+There are three types of comments: block comments, inline comments, and docstrings.
MyPath = '/file.txt'
@@ -57,14 +57,15 @@ result = [
The second is definitely easier to read and understand.
- These scripts are small and if you read even first, you can understand what this code does pretty fast,
+ These scripts are small and even with the first code snippet you can understand what the code does pretty quickly,
but what if the project has thousands and thousands of files in a really complex folder structure?
- Do you want then code what looks like the first example?
- You can save hours sometimes if you write beautiful code that follows style rules.
+ Do you want to work with code that looks like the first example?
+ You can save hours sometimes if you write beautiful code that follows the style guidelines.
- The most important document of Python code style is PEP 8.
- This gives the majority of all Python code style rules. This article will cover the most important rules of PEP 8.
+ The most important code style document for Python is PEP 8.
+ This Python Enhancement Proposal lays out the majority of all Python code style guidelines.
+ This article will cover the most important aspects of PEP 8.
Linters
@@ -75,12 +76,12 @@ result = [
Flake8 points out to you rules what you did break in your code so you can fix them.
- Rules
+ Guidelines
Basics
For indentation, you should use 4 spaces. Using tabs is not suggested, but if you do, you can't mix spaces and tabs.
PEP 8 defines a maximum line length of 79 characters, however,
- we are not so strict - we let teams choose a maximum line length between 79 and 119 characters.
+ we are not so strict - teams are welcome to choose a maximum line length between 79 and 119 characters.
2 blank lines should be left before functions and classes. Single blank lines are used to split sections and make logical breaks.
@@ -109,7 +110,7 @@ ListOfMyClass = List[MyClass]
If you have a chain of mathematic operations that you split into multiple lines, - you should put the operator at the beginning of the line and not to the end of the line. + you should put the operator at the beginning of the line and not the end of the line.
# No
result = (
@@ -124,7 +125,7 @@ result = (
+ 2
* 3
)
- If you compare against None, you should use is and is not, but not compare equality.
If you ever check if something is equivalent to None, you should use is and is not instead of the == operator.
# No
if variable == None:
print("Variable is None")
@@ -134,7 +135,7 @@ if variable is None:
print("Variable is None")
You should prefer using <item one> is not <item two> over not <item one> is <item two>.
- Using second makes it harder to understand the expression.
+ Using the latter makes it harder to understand what the expression is trying to do.
# No
if not variable is None:
@@ -153,13 +154,13 @@ import pathlib, os
# Yes
import os
import pathlib
- Wildcard imports should be avoided in most cases. They make unclear where what comes from.
+Wildcard imports should be avoided in most cases. It clutters the namespace and makes it less clear where functions or classes are coming from.
# No
from pathlib import *
# Yes
from pathlib import Path
- You should use isort imports order specification, what means:
+You should use isort imports order specification, which means:
__future__ imports, standard library imports,
@@ -181,8 +182,12 @@ from pathlib import Path
Comments are really important because they help everyone understand what code does. - But as important as having comments is keeping them up-to-date. - Out-to-date, wrong comments confuse readers. + In general, comments should explain why you are doing something if it's not obvious. + You should aim to write code that makes it obvious what it is doing and you can use the comments to explain why and provide some context. +
++ Keep in mind that just as important as having comments, is making sure they stay up to date. + Out-of-date and incorrect comments confuse readers of your code (including future you).
Comments content should start with a capital letter and be a full sentence(s).
There are three types of comments: block comments, inline comments, and docstrings.
@@ -191,8 +196,8 @@ from pathlib import Path
Probably most common comment type. Should be indented to the same level as the code they describe.
- Each line in the block comment has to start with # what should be followed by a single space,
- except for text indention inside the comment. To separate paragraphs, use one line containing only #.
+ Each line in the block comment has to start with # and should be followed by a single space.
+ To separate paragraphs, use one line containing only #.
if variable is None or variable == 1:
# If variable is None, something went wrong previously.
@@ -227,13 +232,13 @@ x = x + 1 # Compensate for border
Last, but not least important comment type is docstring, which is a short version of documentation string. Docstring rules haven't been defined by PEP 8, but by PEP 257 instead. - Docstrings should start and end with three quotes (""").
+Docstrings should start and end with three quotes (""").
There are two types of docstrings: one-line docstrings and multiline docstrings.
One-line docstrings have to start and end in the same line, while multiline docstrings start and end in different lines. Multiline docstring has two parts: summary line and a longer description, which are separated by one empty line. - The multiline docstring start and end quotes should be at different lines than the content. + The multiline docstring start and end quotes should be on different lines than the content.
# This is a one-line docstring.
"""This is one line module docstring."""
--
cgit v1.2.3
From 0bfa8c16ba0bdee49403a1e67487bf9a47053f6d Mon Sep 17 00:00:00 2001
From: Matteo Bertucci
Date: Fri, 9 Jul 2021 17:42:48 +0200
Subject: Code jam: switch the right menu to ongoing
---
pydis_site/templates/events/index.html | 2 +-
pydis_site/templates/events/pages/code-jams/_index.html | 2 +-
.../templates/events/sidebar/code-jams/ongoing-code-jam.html | 8 ++++++++
.../templates/events/sidebar/code-jams/upcoming-code-jam.html | 8 --------
pydis_site/templates/events/sidebar/ongoing-event.html | 8 ++++++++
pydis_site/templates/events/sidebar/upcoming-event.html | 8 --------
6 files changed, 18 insertions(+), 18 deletions(-)
create mode 100644 pydis_site/templates/events/sidebar/code-jams/ongoing-code-jam.html
delete mode 100644 pydis_site/templates/events/sidebar/code-jams/upcoming-code-jam.html
create mode 100644 pydis_site/templates/events/sidebar/ongoing-event.html
delete mode 100644 pydis_site/templates/events/sidebar/upcoming-event.html
(limited to 'pydis_site')
diff --git a/pydis_site/templates/events/index.html b/pydis_site/templates/events/index.html
index 64bf2c25..daad1c9c 100644
--- a/pydis_site/templates/events/index.html
+++ b/pydis_site/templates/events/index.html
@@ -121,6 +121,6 @@
{% endblock %}
{% block sidebar %}
- {% include "events/sidebar/upcoming-event.html" %}
+ {% include "events/sidebar/ongoing-event.html" %}
{% include "events/sidebar/events-list.html" %}
{% endblock %}
diff --git a/pydis_site/templates/events/pages/code-jams/_index.html b/pydis_site/templates/events/pages/code-jams/_index.html
index fcbfa4d9..22a86db3 100644
--- a/pydis_site/templates/events/pages/code-jams/_index.html
+++ b/pydis_site/templates/events/pages/code-jams/_index.html
@@ -66,7 +66,7 @@
{% endblock %}
{% block sidebar %}
- {% include "events/sidebar/code-jams/upcoming-code-jam.html" %}
+ {% include "events/sidebar/code-jams/ongoing-code-jam.html" %}
{% include "events/sidebar/code-jams/previous-code-jams.html" %}
{% include "events/sidebar/code-jams/useful-information.html" %}
{% endblock %}
diff --git a/pydis_site/templates/events/sidebar/code-jams/ongoing-code-jam.html b/pydis_site/templates/events/sidebar/code-jams/ongoing-code-jam.html
new file mode 100644
index 00000000..f4fa3a37
--- /dev/null
+++ b/pydis_site/templates/events/sidebar/code-jams/ongoing-code-jam.html
@@ -0,0 +1,8 @@
+{% load static %}
+
+
+ Ongoing Code Jam
+
+
+
+
diff --git a/pydis_site/templates/events/sidebar/code-jams/upcoming-code-jam.html b/pydis_site/templates/events/sidebar/code-jams/upcoming-code-jam.html
deleted file mode 100644
index 19806b4e..00000000
--- a/pydis_site/templates/events/sidebar/code-jams/upcoming-code-jam.html
+++ /dev/null
@@ -1,8 +0,0 @@
-{% load static %}
-
-
- Upcoming Code Jam
-
-
-
-
diff --git a/pydis_site/templates/events/sidebar/ongoing-event.html b/pydis_site/templates/events/sidebar/ongoing-event.html
new file mode 100644
index 00000000..37dfdf77
--- /dev/null
+++ b/pydis_site/templates/events/sidebar/ongoing-event.html
@@ -0,0 +1,8 @@
+{% load static %}
+
+
+
+
+
+
+
diff --git a/pydis_site/templates/events/sidebar/upcoming-event.html b/pydis_site/templates/events/sidebar/upcoming-event.html
deleted file mode 100644
index cfa4cf88..00000000
--- a/pydis_site/templates/events/sidebar/upcoming-event.html
+++ /dev/null
@@ -1,8 +0,0 @@
-{% load static %}
-
-
-
-
-
-
-
--
cgit v1.2.3
From 5a7ea51c39a1eab103d06b64e23f9e2840b64ccf Mon Sep 17 00:00:00 2001
From: Matteo Bertucci
Date: Fri, 9 Jul 2021 17:44:27 +0200
Subject: Code jam: switch home to use the ongoing banner
---
pydis_site/templates/home/index.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'pydis_site')
diff --git a/pydis_site/templates/home/index.html b/pydis_site/templates/home/index.html
index 2efa5b49..072e3817 100644
--- a/pydis_site/templates/home/index.html
+++ b/pydis_site/templates/home/index.html
@@ -12,7 +12,7 @@
@@ -48,7 +48,7 @@
{# Code Jam banner #}
--
cgit v1.2.3
From 877d3c219b56ad170a382e397b3f174d9ee8b948 Mon Sep 17 00:00:00 2001
From: Matteo Bertucci
Date: Fri, 9 Jul 2021 17:44:49 +0200
Subject: Code jam: use case name in code style
---
pydis_site/templates/events/pages/code-jams/code-style-guide.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'pydis_site')
diff --git a/pydis_site/templates/events/pages/code-jams/code-style-guide.html b/pydis_site/templates/events/pages/code-jams/code-style-guide.html
index 31156da2..4ff5baaf 100644
--- a/pydis_site/templates/events/pages/code-jams/code-style-guide.html
+++ b/pydis_site/templates/events/pages/code-jams/code-style-guide.html
@@ -91,7 +91,7 @@ result = [
def my_function():
my_variable = "value"
- Class and type variable names should use the camel case style.
+Class and type variable names should use the PascalCase style.
from typing import List
@@ -99,7 +99,7 @@ class MyClass:
pass
ListOfMyClass = List[MyClass]
- Constant names should be all uppercase, and words should be separated with underscores.
+Constant names should use the SCREAMING_SNAKE_CASE style.
MY_CONSTANT = 1
You should avoid single-character names, as these might be confusing.
--
cgit v1.2.3
From c52c606e6ae09291378c6eae17938d642dc2e463 Mon Sep 17 00:00:00 2001
From: Johannes Christ
- To enter into the code jam you must complete The Qualifier and submit the sign-up form. - Don't forget to join us on Discord at discord.gg/python! -
+ 63 teams started out on July 9th 2021. By the end of the jam, 51 teams made project submissions. Check them all out here: +diff --git a/pydis_site/templates/events/pages/code-jams/8/submissions.html b/pydis_site/templates/events/pages/code-jams/8/submissions.html new file mode 100644 index 00000000..0bc14b9e --- /dev/null +++ b/pydis_site/templates/events/pages/code-jams/8/submissions.html @@ -0,0 +1,484 @@ +{% extends "events/base_sidebar.html" %} + +{% load static %} + +{% block title %}Summer Code Jam 2021{% endblock %} + +{% block breadcrumb %} +
+ Below is a list of all projects submitted by the end of Summer Code Jam 2021 +
+ +Acute Alligators
+Adaptable Antelopes
+Astounding Arapaimas
+Beatific Bulldogs
+Benevolent Bonobos
+Blessed Badgers
+Bright Bluefins
+Businesslike Buffalo
+Canny Capybaras
+Cheerful Cheetahs
+Classic Clownfish
+Considerate Coatis
+Dedicated Dugongs
+Discrete Dingos
+Enlightened Elks
+Esteemed Emus
+Favorable Fishers
+Feisty Ferrets
+Gallant Grasshoppers
+Grand Geckos
+Hospitable Hares
+Humorous Honeybees
+Jaunty Jackals
+Jazzed Jerboas
+Jubilant Jellyfish
+Lovable Lobsters
+Magical Muskrats
+Mature Magpies
+Merciful Millipedes
+Meteoric Minks
+Modern Meerkats
+Notable Newts
+Notorious Narwhals
+Patient Panthers
+Perceptive Porcupines
+Poetic Pumas
+Purposeful Pangolins
+Quirky Quokkas
+Respectful Racoons
+Rhapsodic Rabbits
+Robust Reindeer
+Scholarly Skunks
+Secretive Squirrels
+Sleek Snails
+Spellbinding Squids
+Stylish Salamanders
+Tactful Tunas
+Transcendent Tarsiers
+Tubular Terriers
+Virtuous Vultures
+Whimsical Woolly Mammoths
+Acute Alligators
@@ -30,7 +30,7 @@Adaptable Antelopes
@@ -39,7 +39,7 @@Astounding Arapaimas
@@ -48,7 +48,7 @@Beatific Bulldogs
@@ -57,7 +57,7 @@Benevolent Bonobos
@@ -66,7 +66,7 @@Blessed Badgers
@@ -75,7 +75,7 @@Bright Bluefins
@@ -84,7 +84,7 @@Businesslike Buffalo
@@ -93,7 +93,7 @@Canny Capybaras
@@ -102,7 +102,7 @@Cheerful Cheetahs
@@ -111,7 +111,7 @@Classic Clownfish
@@ -120,7 +120,7 @@Considerate Coatis
@@ -129,7 +129,7 @@Dedicated Dugongs
@@ -138,7 +138,7 @@Discrete Dingos
@@ -147,7 +147,7 @@Enlightened Elks
@@ -156,7 +156,7 @@Esteemed Emus
@@ -165,7 +165,7 @@Favorable Fishers
@@ -174,7 +174,7 @@Feisty Ferrets
@@ -183,7 +183,7 @@Gallant Grasshoppers
@@ -192,7 +192,7 @@Grand Geckos
@@ -201,7 +201,7 @@Hospitable Hares
@@ -210,7 +210,7 @@Humorous Honeybees
@@ -219,7 +219,7 @@Jaunty Jackals
@@ -228,7 +228,7 @@Jazzed Jerboas
@@ -237,7 +237,7 @@Jubilant Jellyfish
@@ -246,7 +246,7 @@Lovable Lobsters
@@ -255,7 +255,7 @@Magical Muskrats
@@ -264,7 +264,7 @@Mature Magpies
@@ -273,7 +273,7 @@Merciful Millipedes
@@ -282,7 +282,7 @@Meteoric Minks
@@ -291,7 +291,7 @@Modern Meerkats
@@ -300,7 +300,7 @@Notable Newts
@@ -309,7 +309,7 @@Notorious Narwhals
@@ -318,7 +318,7 @@Patient Panthers
@@ -327,7 +327,7 @@Perceptive Porcupines
@@ -336,7 +336,7 @@Poetic Pumas
@@ -345,7 +345,7 @@Purposeful Pangolins
@@ -354,7 +354,7 @@Quirky Quokkas
@@ -363,7 +363,7 @@Respectful Racoons
@@ -372,7 +372,7 @@Rhapsodic Rabbits
@@ -381,7 +381,7 @@Robust Reindeer
@@ -390,7 +390,7 @@Scholarly Skunks
@@ -399,7 +399,7 @@Secretive Squirrels
@@ -408,7 +408,7 @@Sleek Snails
@@ -417,7 +417,7 @@Spellbinding Squids
@@ -426,7 +426,7 @@Stylish Salamanders
@@ -435,7 +435,7 @@Tactful Tunas
@@ -444,7 +444,7 @@Transcendent Tarsiers
@@ -453,7 +453,7 @@Tubular Terriers
@@ -462,7 +462,7 @@Virtuous Vultures
@@ -471,7 +471,7 @@Whimsical Woolly Mammoths
-- cgit v1.2.3 From 4625841f59cfb4d2097a67232f67e3e3bc78e2e8 Mon Sep 17 00:00:00 2001 From: mbaruhAcute Alligators
@@ -30,7 +30,7 @@Adaptable Antelopes
@@ -39,7 +39,7 @@Astounding Arapaimas
@@ -48,7 +48,7 @@Beatific Bulldogs
@@ -57,7 +57,7 @@Benevolent Bonobos
@@ -66,7 +66,7 @@Blessed Badgers
@@ -75,7 +75,7 @@Bright Bluefins
@@ -84,7 +84,7 @@Businesslike Buffalo
@@ -93,7 +93,7 @@Canny Capybaras
@@ -102,7 +102,7 @@Cheerful Cheetahs
@@ -111,7 +111,7 @@Classic Clownfish
@@ -120,7 +120,7 @@Considerate Coatis
@@ -129,7 +129,7 @@Dedicated Dugongs
@@ -138,7 +138,7 @@Discrete Dingos
@@ -147,7 +147,7 @@Enlightened Elks
@@ -156,7 +156,7 @@Esteemed Emus
@@ -165,7 +165,7 @@Favorable Fishers
@@ -174,7 +174,7 @@Feisty Ferrets
@@ -183,7 +183,7 @@Gallant Grasshoppers
@@ -192,7 +192,7 @@Grand Geckos
@@ -201,7 +201,7 @@Hospitable Hares
@@ -210,7 +210,7 @@Humorous Honeybees
@@ -219,7 +219,7 @@Jaunty Jackals
@@ -228,7 +228,7 @@Jazzed Jerboas
@@ -237,7 +237,7 @@Jubilant Jellyfish
@@ -246,7 +246,7 @@Lovable Lobsters
@@ -255,7 +255,7 @@Magical Muskrats
@@ -264,7 +264,7 @@Mature Magpies
@@ -273,7 +273,7 @@Merciful Millipedes
@@ -282,7 +282,7 @@Meteoric Minks
@@ -291,7 +291,7 @@Modern Meerkats
@@ -300,7 +300,7 @@Notable Newts
@@ -309,7 +309,7 @@Notorious Narwhals
@@ -318,7 +318,7 @@Patient Panthers
@@ -327,7 +327,7 @@Perceptive Porcupines
@@ -336,7 +336,7 @@Poetic Pumas
@@ -345,7 +345,7 @@Purposeful Pangolins
@@ -354,7 +354,7 @@Quirky Quokkas
@@ -363,7 +363,7 @@Respectful Racoons
@@ -372,7 +372,7 @@Rhapsodic Rabbits
@@ -381,7 +381,7 @@Robust Reindeer
@@ -390,7 +390,7 @@Scholarly Skunks
@@ -399,7 +399,7 @@Secretive Squirrels
@@ -408,7 +408,7 @@Sleek Snails
@@ -417,7 +417,7 @@Spellbinding Squids
@@ -426,7 +426,7 @@Stylish Salamanders
@@ -435,7 +435,7 @@Tactful Tunas
@@ -444,7 +444,7 @@Transcendent Tarsiers
@@ -453,7 +453,7 @@Tubular Terriers
@@ -462,7 +462,7 @@Virtuous Vultures
@@ -471,7 +471,7 @@Whimsical Woolly Mammoths
-- cgit v1.2.3 From 65adf37f8d40e31d6c10f3dd3840d27299a6d993 Mon Sep 17 00:00:00 2001 From: Ethan