Skip to content

Commit

Permalink
Merge pull request #7 from RichDoherty/develop
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
RichDoherty authored Nov 5, 2021
2 parents 03e164e + 3e706ac commit ddf17cf
Show file tree
Hide file tree
Showing 434 changed files with 17,071 additions and 13,709 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ updates:
# We should test that this does not cause issue
# google/blockly-samples#665 when version 17 is released.
versions: "16.x"
commit-message:
prefix: "chore(deps)"
labels:
- "PR: dependencies"
41 changes: 41 additions & 0 deletions .github/workflows/assign_reviewers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Assign requested reviewers

# This workflow adds requested reviewers as assignees. If you remove a
# requested reviewer, it will not remove them as an assignee.
#
# See https://github.com/google/blockly/issues/5643 for more
# information on why this was added.
#
# N.B.: Runs with a read-write repo token. Do not check out the
# submitted branch!
on:
pull_request_target:
types: [review_requested]

jobs:
requested-reviewer:
runs-on: ubuntu-latest
steps:
- name: Assign requested reviewer
uses: actions/github-script@v5
with:
script: |
try {
if (context.payload.pull_request === undefined) {
throw new Error("Can't get pull_request payload. " +
'Check a request reviewer event was triggered.');
}
const reviewers = context.payload.pull_request.requested_reviewers;
// Assignees takes in a list of logins rather than the
// reviewer object.
const reviewerNames = reviewers.map(reviewer => reviewer.login);
const {number:issue_number} = context.payload.pull_request;
github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
assignees: reviewerNames
});
} catch (error) {
core.setFailed(error.message);
}
23 changes: 23 additions & 0 deletions .github/workflows/check_clang_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check clang format

# N.B.: Runs with a read-only repo token. Safe(ish) to check out the
# submitted branch.
on: [pull_request]

jobs:
clang-formatter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: DoozyX/clang-format-lint-action@v0.12
with:
source: 'core'
extensions: 'js'
clangFormatVersion: 12
style: Google

# The Report clang format workflow (report_clang_format.yml) will
# run (if required) after this one to post a comment to the PR.
# (Note that the version of that workflow run will be the one on
# the master (default) branch, not the PR target branch.)
5 changes: 3 additions & 2 deletions appengine/expiration.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ def delete_expired():
results = query.fetch(limit=QUERY_LIMIT, keys_only=True)
for x in results:
x.delete()
return len(results)


def app(environ, start_response):
out = ""
headers = [
("Content-Type", "text/plain")
]
start_response("200 OK", headers)
delete_expired()
n = delete_expired()
out = "%d records deleted." % n
return [out.encode("utf-8")]
13 changes: 6 additions & 7 deletions appengine/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

/**
* @fileoverview Loading and saving blocks with localStorage and cloud storage.
* @author q.neutron@gmail.com (Quynh Neutron)
*/
'use strict';

Expand Down Expand Up @@ -59,7 +58,7 @@ BlocklyStorage.link = function(opt_workspace) {
var xml = Blockly.Xml.workspaceToDom(workspace, true);
// Remove x/y coordinates from XML if there's only one block stack.
// There's no reason to store this, removing it helps with anonymity.
if (workspace.getTopBlocks(false).length == 1 && xml.querySelector) {
if (workspace.getTopBlocks(false).length === 1 && xml.querySelector) {
var block = xml.querySelector('block');
if (block) {
block.removeAttribute('x');
Expand Down Expand Up @@ -116,17 +115,17 @@ BlocklyStorage.makeRequest_ = function(url, name, content, workspace) {
* @private
*/
BlocklyStorage.handleRequest_ = function() {
if (BlocklyStorage.httpRequest_.readyState == 4) {
if (BlocklyStorage.httpRequest_.status != 200) {
if (BlocklyStorage.httpRequest_.readyState === 4) {
if (BlocklyStorage.httpRequest_.status !== 200) {
BlocklyStorage.alert(BlocklyStorage.HTTPREQUEST_ERROR + '\n' +
'httpRequest_.status: ' + BlocklyStorage.httpRequest_.status);
} else {
var data = BlocklyStorage.httpRequest_.responseText.trim();
if (BlocklyStorage.httpRequest_.name == 'xml') {
if (BlocklyStorage.httpRequest_.name === 'xml') {
window.location.hash = data;
BlocklyStorage.alert(BlocklyStorage.LINK_ALERT.replace('%1',
window.location.href));
} else if (BlocklyStorage.httpRequest_.name == 'key') {
} else if (BlocklyStorage.httpRequest_.name === 'key') {
if (!data.length) {
BlocklyStorage.alert(BlocklyStorage.HASH_ERROR.replace('%1',
window.location.hash));
Expand All @@ -153,7 +152,7 @@ BlocklyStorage.monitorChanges_ = function(workspace) {
function change() {
var xmlDom = Blockly.Xml.workspaceToDom(workspace);
var xmlText = Blockly.Xml.domToText(xmlDom);
if (startXmlText != xmlText) {
if (startXmlText !== xmlText) {
window.location.hash = '';
workspace.removeChangeListener(change);
}
Expand Down
1 change: 0 additions & 1 deletion blockly_uncompressed.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

/**
* @fileoverview Bootstrap code to load Blockly in uncompiled mode.
* @author cpcallen@google.com (Christopher Allen)
*/
'use strict';

Expand Down
31 changes: 15 additions & 16 deletions blocks/colour.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
* passed to defineBlocksWithJsonArray(..) must be strict JSON: double quotes
* only, no outside references, no functions, no trailing commas, etc. The one
* exception is end-of-line comments, which the scraper will remove.
* @author fraser@google.com (Neil Fraser)
*/
'use strict';

Expand All @@ -38,14 +37,14 @@ Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT
{
"type": "field_colour",
"name": "COLOUR",
"colour": "#ff0000"
}
"colour": "#ff0000",
},
],
"output": "Colour",
"helpUrl": "%{BKY_COLOUR_PICKER_HELPURL}",
"style": "colour_blocks",
"tooltip": "%{BKY_COLOUR_PICKER_TOOLTIP}",
"extensions": ["parent_tooltip_when_inline"]
"extensions": ["parent_tooltip_when_inline"],
},

// Block for random colour.
Expand All @@ -55,7 +54,7 @@ Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT
"output": "Colour",
"helpUrl": "%{BKY_COLOUR_RANDOM_HELPURL}",
"style": "colour_blocks",
"tooltip": "%{BKY_COLOUR_RANDOM_TOOLTIP}"
"tooltip": "%{BKY_COLOUR_RANDOM_TOOLTIP}",
},

// Block for composing a colour from RGB components.
Expand All @@ -67,25 +66,25 @@ Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT
"type": "input_value",
"name": "RED",
"check": "Number",
"align": "RIGHT"
"align": "RIGHT",
},
{
"type": "input_value",
"name": "GREEN",
"check": "Number",
"align": "RIGHT"
"align": "RIGHT",
},
{
"type": "input_value",
"name": "BLUE",
"check": "Number",
"align": "RIGHT"
}
"align": "RIGHT",
},
],
"output": "Colour",
"helpUrl": "%{BKY_COLOUR_RGB_HELPURL}",
"style": "colour_blocks",
"tooltip": "%{BKY_COLOUR_RGB_TOOLTIP}"
"tooltip": "%{BKY_COLOUR_RGB_TOOLTIP}",
},

// Block for blending two colours together.
Expand All @@ -98,24 +97,24 @@ Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT
"type": "input_value",
"name": "COLOUR1",
"check": "Colour",
"align": "RIGHT"
"align": "RIGHT",
},
{
"type": "input_value",
"name": "COLOUR2",
"check": "Colour",
"align": "RIGHT"
"align": "RIGHT",
},
{
"type": "input_value",
"name": "RATIO",
"check": "Number",
"align": "RIGHT"
}
"align": "RIGHT",
},
],
"output": "Colour",
"helpUrl": "%{BKY_COLOUR_BLEND_HELPURL}",
"style": "colour_blocks",
"tooltip": "%{BKY_COLOUR_BLEND_TOOLTIP}"
}
"tooltip": "%{BKY_COLOUR_BLEND_TOOLTIP}",
},
]); // END JSON EXTRACT (Do not delete this comment.)
Loading

0 comments on commit ddf17cf

Please sign in to comment.