Skip to content

Commit ce871e3

Browse files
committed
Merge branch 'main' of github.com:HTTPArchive/almanac.httparchive.org into production
2 parents efc9228 + 0da547a commit ce871e3

346 files changed

Lines changed: 14089 additions & 414 deletions

File tree

Some content is hidden

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

.github/linters/.python-lint

Lines changed: 1 addition & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -55,79 +55,7 @@ confidence=
5555
# --enable=similarities". If you want to run only the classes checker, but have
5656
# no Warning level messages displayed, use"--disable=all --enable=classes
5757
# --disable=W"
58-
disable=print-statement,
59-
parameter-unpacking,
60-
unpacking-in-except,
61-
old-raise-syntax,
62-
backtick,
63-
long-suffix,
64-
old-ne-operator,
65-
old-octal-literal,
66-
import-star-module-level,
67-
non-ascii-bytes-literal,
68-
raw-checker-failed,
69-
bad-inline-option,
70-
locally-disabled,
71-
locally-enabled,
72-
file-ignored,
73-
suppressed-message,
74-
useless-suppression,
75-
deprecated-pragma,
76-
apply-builtin,
77-
basestring-builtin,
78-
buffer-builtin,
79-
cmp-builtin,
80-
coerce-builtin,
81-
execfile-builtin,
82-
file-builtin,
83-
long-builtin,
84-
raw_input-builtin,
85-
reduce-builtin,
86-
standarderror-builtin,
87-
unicode-builtin,
88-
xrange-builtin,
89-
coerce-method,
90-
delslice-method,
91-
getslice-method,
92-
setslice-method,
93-
no-absolute-import,
94-
old-division,
95-
dict-iter-method,
96-
dict-view-method,
97-
next-method-called,
98-
metaclass-assignment,
99-
indexing-exception,
100-
raising-string,
101-
reload-builtin,
102-
oct-method,
103-
hex-method,
104-
nonzero-method,
105-
cmp-method,
106-
input-builtin,
107-
round-builtin,
108-
intern-builtin,
109-
unichr-builtin,
110-
map-builtin-not-iterating,
111-
zip-builtin-not-iterating,
112-
range-builtin-not-iterating,
113-
filter-builtin-not-iterating,
114-
using-cmp-argument,
115-
eq-without-hash,
116-
div-method,
117-
idiv-method,
118-
rdiv-method,
119-
exception-message-attribute,
120-
invalid-str-codec,
121-
sys-max-int,
122-
bad-python3-import,
123-
deprecated-string-function,
124-
deprecated-str-translate-call,
125-
deprecated-itertools-function,
126-
deprecated-types-field,
127-
next-method-defined,
128-
dict-items-not-iterating,
129-
dict-keys-not-iterating,
130-
dict-values-not-iterating
58+
disable=
13159

13260
# Enable the message, report, category or checker with the given id(s). You can
13361
# either give multiple identifier separated by comma (,) or put this option
@@ -424,13 +352,6 @@ max-line-length=100
424352
# Maximum number of lines in a module
425353
max-module-lines=1000
426354

427-
# List of optional constructs for which whitespace checking is disabled. `dict-
428-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
429-
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
430-
# `empty-line` allows space-only lines.
431-
no-space-check=trailing-comma,
432-
dict-separator
433-
434355
# Allow the body of a class to be on the same line as the declaration if body
435356
# contains single statement.
436357
single-line-class-stmt=no

.github/workflows/code-static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uses: actions/checkout@v3
3636
- name: Set up Python 3.8
3737
if: ${{ matrix.language == 'python' }}
38-
uses: actions/setup-python@v4.1.0
38+
uses: actions/setup-python@v4.2.0
3939
with:
4040
python-version: '3.8'
4141
- name: Install dependencies

.github/workflows/linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: |
3232
echo "VALIDATE_ALL_CODEBASE=false" >> $GITHUB_ENV
3333
- name: Lint Code Base
34-
uses: github/super-linter@v4.9.4
34+
uses: github/super-linter@v4.9.6
3535
#uses: docker://github/super-linter:v4.7.1
3636
env:
3737
DEFAULT_BRANCH: main

.github/workflows/lintsql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
# Full git history is needed to get a proper list of changed files within `super-linter`
2020
fetch-depth: 0
2121
- name: Set up Python 3.8
22-
uses: actions/setup-python@v4.1.0
22+
uses: actions/setup-python@v4.2.0
2323
with:
2424
python-version: '3.8'
2525
- name: Lint SQL code

.github/workflows/predeploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
with:
3737
node-version: '16'
3838
- name: Set up Python 3.8
39-
uses: actions/setup-python@v4.1.0
39+
uses: actions/setup-python@v4.2.0
4040
with:
4141
python-version: '3.8'
4242
- name: Install Asian Fonts

.github/workflows/test_website.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
with:
3131
node-version: '16'
3232
- name: Set up Python 3.8
33-
uses: actions/setup-python@v4.1.0
33+
uses: actions/setup-python@v4.2.0
3434
with:
3535
python-version: '3.8'
3636
- name: Run the website
@@ -40,7 +40,7 @@ jobs:
4040
- name: Use more complete checks for generated HTML linting
4141
run: cp -f .github/linters/.htmlhintrc_morechecks .github/linters/.htmlhintrc
4242
- name: Lint Generated HTML
43-
uses: github/super-linter@v4.9.4
43+
uses: github/super-linter@v4.9.6
4444
env:
4545
DEFAULT_BRANCH: main
4646
FILTER_REGEX_INCLUDE: src/static/html/.*

sql/.sqlfluff

Lines changed: 114 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
[sqlfluff]
2-
## verbose is an integer (0-2) indicating the level of log output
2+
# verbose is an integer (0-2) indicating the level of log output
33
verbose = 0
4-
## Turn off color formatting of output
4+
# Turn off color formatting of output
55
nocolor = False
6-
## Supported dialects https://docs.sqlfluff.com/en/stable/dialects.html
7-
## Or run 'sqlfluff dialects'
6+
# Supported dialects https://docs.sqlfluff.com/en/stable/dialects.html
7+
# Or run 'sqlfluff dialects'
88
dialect = bigquery
9-
## One of [raw|jinja|python|placeholder]
9+
# One of [raw|jinja|python|placeholder]
1010
templater = jinja
11-
## Comma separated list of rules to check, or None for all
12-
rules = None
13-
## Comma separated list of rules to exclude, or None
11+
# Comma separated list of rules to check, default to all
12+
rules = all
13+
# Comma separated list of rules to exclude, or None
1414
exclude_rules = L011,L014,L016,L020,L022,L026,L027,L028,L029,L030,L031,L032,L034,L035,L036,L037,L042,L043,L051,L060
1515
# L011 - We don't always alias tables with AS ("FROM table1 AS tb1" instead of "FROM table1 tb1"). Do for columns but not for tables.
1616
# L014 - Unquoted identifiers (e.g. column names) will be mixed case so don't enforce case
@@ -38,7 +38,11 @@ recurse = 0
3838
output_line_length = 80
3939
# Number of passes to run before admitting defeat
4040
runaway_limit = 10
41-
# Ignore linting errors in templated sections
41+
# Ignore errors by category (one or more of the following, separated by commas: lexing,linting,parsing,templating)
42+
ignore = None
43+
# Ignore linting errors found within sections of code coming directly from
44+
# templated code (e.g. from within Jinja curly braces. Note that it does not
45+
# ignore errors from literal code found within template loops.
4246
ignore_templated_areas = True
4347
# can either be autodetect or a valid encoding e.g. utf-8, utf-8-sig
4448
encoding = autodetect
@@ -47,12 +51,26 @@ disable_noqa = False
4751
# Comma separated list of file extensions to lint
4852
# NB: This config will only apply in the root folder
4953
sql_file_exts = .sql,.sql.j2,.dml,.ddl
50-
54+
# Allow fix to run on files, even if they contain parsing errors
55+
# Note altering this is NOT RECOMMENDED as can corrupt SQL
56+
fix_even_unparsable = False
57+
# Very large files can make the parser effectively hang.
58+
# This limit skips files over a certain character length
59+
# and warns the user what has happened.
60+
# Set this to 0 to disable.
61+
large_file_skip_char_limit = 40000
62+
# CPU processes to use while linting.
63+
# If positive, just implies number of processes.
64+
# If negative or zero, implies number_of_cpus - specifed_number.
65+
# e.g. -1 means use all processors but one. 0 means all cpus.
66+
processes = -1
5167

5268
[sqlfluff:indentation]
53-
## See https://docs.sqlfluff.com/en/stable/indentation.html
69+
# See https://docs.sqlfluff.com/en/stable/indentation.html
5470
indented_joins = False
71+
indented_ctes = False
5572
indented_using_on = False
73+
indented_on_contents = True
5674
template_blocks_indent = True
5775

5876
[sqlfluff:templater]
@@ -61,15 +79,7 @@ unwrap_wrapped_queries = True
6179
[sqlfluff:templater:jinja]
6280
apply_dbt_builtins = True
6381

64-
[sqlfluff:templater:jinja:macros]
65-
# Macros provided as builtins for dbt projects
66-
dbt_ref = {% macro ref(model_ref) %}{{model_ref}}{% endmacro %}
67-
dbt_source = {% macro source(source_name, table) %}{{source_name}}_{{table}}{% endmacro %}
68-
dbt_config = {% macro config() %}{% for k in kwargs %}{% endfor %}{% endmacro %}
69-
dbt_var = {% macro var(variable) %}item{% endmacro %}
70-
dbt_is_incremental = {% macro is_incremental() %}True{% endmacro %}
71-
72-
# Some rules can be configured directly from the config common to other rules.
82+
# Some rules can be configured directly from the config common to other rules
7383
[sqlfluff:rules]
7484
tab_space_size = 2
7585
max_line_length = 80
@@ -81,31 +91,100 @@ unquoted_identifiers_policy = all
8191

8292
# Some rules have their own specific config.
8393
[sqlfluff:rules:L003]
84-
lint_templated_tokens = True
94+
hanging_indents = True
8595

8696
[sqlfluff:rules:L007]
8797
operator_new_lines = before
8898

8999
[sqlfluff:rules:L010]
90100
# Keywords
91101
capitalisation_policy = upper
102+
# Comma separated list of words to ignore for this rule
103+
ignore_words = None
104+
ignore_words_regex = None
105+
106+
[sqlfluff:rules:L011]
107+
# Aliasing preference for tables
108+
aliasing = explicit
92109

93110
[sqlfluff:rules:L012]
94111
# Aliasing preference for columns
95112
aliasing = explicit
96113

114+
[sqlfluff:rules:L014]
115+
# Unquoted identifiers
116+
extended_capitalisation_policy = consistent
117+
# Comma separated list of words to ignore for this rule
118+
ignore_words = None
119+
ignore_words_regex = None
120+
121+
[sqlfluff:rules:L016]
122+
# Line length
123+
ignore_comment_lines = False
124+
ignore_comment_clauses = False
125+
126+
[sqlfluff:rules:L027]
127+
# Comma separated list of words to ignore for this rule
128+
ignore_words = None
129+
ignore_words_regex = None
130+
131+
[sqlfluff:rules:L026]
132+
# References must be in FROM clause
133+
# Disabled for some dialects (e.g. bigquery)
134+
force_enable = False
135+
136+
[sqlfluff:rules:L028]
137+
# References must be consistently used
138+
# Disabled for some dialects (e.g. bigquery)
139+
force_enable = False
140+
141+
[sqlfluff:rules:L029]
142+
# Keywords should not be used as identifiers.
143+
unquoted_identifiers_policy = aliases
144+
quoted_identifiers_policy = none
145+
# Comma separated list of words to ignore for this rule
146+
ignore_words = None
147+
ignore_words_regex = None
148+
149+
[sqlfluff:rules:L030]
150+
# Function names
151+
extended_capitalisation_policy = consistent
152+
# Comma separated list of words to ignore for this rule
153+
ignore_words = None
154+
ignore_words_regex = None
155+
156+
[sqlfluff:rules:L031]
157+
# Avoid table aliases in from clauses and join conditions.
158+
# Disabled for some dialects (e.g. bigquery)
159+
force_enable = False
160+
161+
[sqlfluff:rules:L036]
162+
wildcard_policy = single
163+
97164
[sqlfluff:rules:L038]
165+
# Trailing commas
98166
select_clause_trailing_comma = forbid
99167

100168
[sqlfluff:rules:L040]
101169
# Null & Boolean Literals
102170
capitalisation_policy = consistent
171+
# Comma separated list of words to ignore for this rule
172+
ignore_words = None
173+
ignore_words_regex = None
174+
175+
[sqlfluff:rules:L042]
176+
# By default, allow subqueries in from clauses, but not join clauses
177+
forbid_subquery_in = join
103178

104179
[sqlfluff:rules:L047]
105180
# Consistent syntax to count all rows
106181
prefer_count_1 = False
107182
prefer_count_0 = True
108183

184+
[sqlfluff:rules:L051]
185+
# Fully qualify JOIN clause
186+
fully_qualify_join_types = inner
187+
109188
[sqlfluff:rules:L052]
110189
# Semi-colon formatting approach
111190
multiline_newline = False
@@ -121,6 +200,15 @@ unquoted_identifiers_policy = all
121200
quoted_identifiers_policy = all
122201
allow_space_in_identifier = False
123202
additional_allowed_characters = "-."
203+
ignore_words = None
204+
ignore_words_regex = None
205+
206+
[sqlfluff:rules:L059]
207+
# Policy on quoted and unquoted identifiers
208+
prefer_quoted_identifiers = False
209+
ignore_words = None
210+
ignore_words_regex = None
211+
force_enable = False
124212

125213
[sqlfluff:rules:L062]
126214
# Comma separated list of blocked words that should not be used
@@ -138,9 +226,14 @@ blocked_regex = (2022_?05_?12|2022_?06_?09|2022_?07_?01|2021_?06_?01)
138226
extended_capitalisation_policy = upper
139227
# Comma separated list of words to ignore for this rule
140228
ignore_words = None
229+
ignore_words_regex = None
141230

142231
[sqlfluff:rules:L064]
143232
# Consistent usage of preferred quotes for quoted literals
144233
preferred_quoted_literal_style = single_quotes
145234
# Disabled for dialects that do not support single and double quotes for quoted literals (e.g. Postgres)
146235
force_enable = False
236+
237+
[sqlfluff:rules:L066]
238+
min_alias_length = None
239+
max_alias_length = None

sql/2021/structured-data/rdfa_type_ofs.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Count RDFa Type Ofs
33
CREATE TEMP FUNCTION getRDFaTypeOfs(rendered STRING)
44
RETURNS ARRAY<STRING>
5-
LANGUAGE js AS """
5+
LANGUAGE js AS r"""
66
try {
77
rendered = JSON.parse(rendered);
88
return rendered.rdfa_typeofs.map(typeOf => typeOf.toLowerCase().trim().split(/\s+/)).flat();

0 commit comments

Comments
 (0)