diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 000000000..486847524 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,17 @@ +# GitHub Action to automate the identification of common misspellings in text files. +# https://github.com/codespell-project/actions-codespell +# https://github.com/codespell-project/codespell +name: codespell +on: [push, pull_request] +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: codespell-project/actions-codespell@master + with: + check_filenames: true + skip: ./.git,./data/territory_languages.json,./data/imagery.json,./data/languages.json,./data/locales.json,./data/address_formats.json,./dist/locales,./docs/img,./dist/img,./data/presets/categories.json,./data/presets/fields.json,./data/presets/presets.json,./data/presets.yaml,./data/taginfo.json,./data/deprecated.json + ignore_words_list: "auxilary,casette,cemetary,chancel,childs,files',froms,generat,guerilla,kindergarden,nd,specialties,vias,visibles,tos" + only_warn: 1 diff --git a/data/presets/presets/amenity/kindergarten.json b/data/presets/presets/amenity/kindergarten.json index 5285eddf3..9d0ca7710 100644 --- a/data/presets/presets/amenity/kindergarten.json +++ b/data/presets/presets/amenity/kindergarten.json @@ -30,6 +30,7 @@ "point" ], "terms": [ + "kindergarten", "kindergarden", "pre-school" ], diff --git a/data/presets/presets/building/farm_auxiliary.json b/data/presets/presets/building/farm_auxiliary.json index 52ca52531..9290a9958 100644 --- a/data/presets/presets/building/farm_auxiliary.json +++ b/data/presets/presets/building/farm_auxiliary.json @@ -8,6 +8,7 @@ }, "terms": [ "agriculture", + "auxiliary", "auxilary", "chicken coop", "farm auxiliary", diff --git a/data/presets/presets/building/kindergarten.json b/data/presets/presets/building/kindergarten.json index 3bba5279f..dfe6d3b51 100644 --- a/data/presets/presets/building/kindergarten.json +++ b/data/presets/presets/building/kindergarten.json @@ -4,6 +4,7 @@ "area" ], "terms": [ + "kindergarten", "kindergarden", "pre-school" ], diff --git a/data/presets/presets/shop/video.json b/data/presets/presets/shop/video.json index 5283fc6a6..3a7000d55 100644 --- a/data/presets/presets/shop/video.json +++ b/data/presets/presets/shop/video.json @@ -11,6 +11,7 @@ "terms": [ "DVD", "VHS", + "video cassette", "video casette" ], "tags": { diff --git a/data/presets/presets/tourism/artwork/graffiti.json b/data/presets/presets/tourism/artwork/graffiti.json index 077e0bde3..1cffe8138 100644 --- a/data/presets/presets/tourism/artwork/graffiti.json +++ b/data/presets/presets/tourism/artwork/graffiti.json @@ -20,6 +20,7 @@ }, "terms": [ "Street Artwork", + "Guerrilla Artwork", "Guerilla Artwork", "Graffiti Artwork" ], diff --git a/modules/validations/almost_junction.js b/modules/validations/almost_junction.js index beaa2beb0..4f25f0d64 100644 --- a/modules/validations/almost_junction.js +++ b/modules/validations/almost_junction.js @@ -170,11 +170,11 @@ export function validationAlmostJunction(context) { return false; } - let occurences = 0; + let occurrences = 0; for (const index in way.nodes) { if (way.nodes[index] === node.id) { - occurences += 1; - if (occurences > 1) { + occurrences += 1; + if (occurrences > 1) { return false; } } diff --git a/modules/validations/impossible_oneway.js b/modules/validations/impossible_oneway.js index 7e51a2b55..10567be98 100644 --- a/modules/validations/impossible_oneway.js +++ b/modules/validations/impossible_oneway.js @@ -46,11 +46,11 @@ export function validationImpossibleOneway() { } function nodeOccursMoreThanOnce(way, nodeID) { - var occurences = 0; + var occurrences = 0; for (var index in way.nodes) { if (way.nodes[index] === nodeID) { - occurences += 1; - if (occurences > 1) return true; + occurrences += 1; + if (occurrences > 1) return true; } } return false; diff --git a/test/spec/geo/geo.js b/test/spec/geo/geo.js index 76c77ca09..be9929b23 100644 --- a/test/spec/geo/geo.js +++ b/test/spec/geo/geo.js @@ -104,7 +104,7 @@ describe('iD.geo - geography', function() { var b = [0, 0]; expect(iD.geoSphericalDistance(a, b)).to.eql(0); }); - it('a straight 1 degree line at the equator is aproximately 111 km', function() { + it('a straight 1 degree line at the equator is approximately 111 km', function() { var a = [0, 0]; var b = [1, 0]; expect(iD.geoSphericalDistance(a, b)).to.be.closeTo(110946, 10); diff --git a/test/spec/osm/lanes.js b/test/spec/osm/lanes.js index 214a25da4..4d7a69e94 100644 --- a/test/spec/osm/lanes.js +++ b/test/spec/osm/lanes.js @@ -419,7 +419,7 @@ describe('iD.Lanes', function() { expect(bothways.length).to.eql(0); }); - it('should have corrent number of direction elements', function() { + it('should have correct number of direction elements', function() { var lanes = iD.osmWay({tags: { highway: 'residential', lanes: 5, 'lanes:backward': 1, 'lanes:both_ways': 1 }}).lanes().lanes; var forward = lanes.filter(function(l) { return l.direction === 'forward'; @@ -1018,7 +1018,7 @@ describe('iD.Lanes', function() { highway: 'residential', lanes: 5, maxspeed: '30kmh', - 'maxspeed:lanes': '30|40|fourty|40|40' + 'maxspeed:lanes': '30|40|forty|40|40' } }).lanes().metadata.maxspeedLanes; expect(maxspeedLanes.unspecified).to.deep.equal([ @@ -1029,7 +1029,7 @@ describe('iD.Lanes', function() { highway: 'residential', lanes: 5, maxspeed: '30kmh', - 'maxspeed:lanes': '30|40|fourty|40|random' + 'maxspeed:lanes': '30|40|forty|40|random' } }).lanes().metadata.maxspeedLanes; @@ -1057,7 +1057,7 @@ describe('iD.Lanes', function() { highway: 'residential', lanes: 5, maxspeed: '30kmh', - 'maxspeed:lanes': '30|40|fourty|40|40' + 'maxspeed:lanes': '30|40|forty|40|40' } }).lanes().lanes; var maxspeedLanes = lanes.unspecified.map(function (l) { diff --git a/test/spec/services/taginfo.js b/test/spec/services/taginfo.js index 80d46cd7f..0207fa0bd 100644 --- a/test/spec/services/taginfo.js +++ b/test/spec/services/taginfo.js @@ -261,7 +261,7 @@ describe('iD.serviceTaginfo', function() { server.respondWith('GET', /\/key\/values/, [200, { 'Content-Type': 'application/json' }, '{"data":[{"value":"parking","description":"A place for parking cars", "fraction":0.2},' - + '{"value":"PArking","description":"A common mispelling", "fraction":0.2},' + + '{"value":"PArking","description":"A common misspelling", "fraction":0.2},' + '{"value":"parking;partying","description":"A place for parking cars *and* partying", "fraction":0.2},' + '{"value":"parking, partying","description":"A place for parking cars *and* partying", "fraction":0.2},' + '{"value":"*","description":"", "fraction":0.2}]}']