Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .codespellignore

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/codespell.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Check spelling

on:
pull_request:
push:
branches: [ master ]
merge_group:

jobs:
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master
28 changes: 28 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[files]
extend-exclude = [
".git/",
"fixture/*.csv",
"fixture/ga4_report_imported_entry_pages.json",
"fixture/ga4_report_imported_locations.json",
"priv/*.csv",
"priv/ref_inspector/*.yml",
"priv/referer_favicon_domains.json",
"priv/ua_inspector/*.yml",
]
ignore-hidden = false

[default]
extend-ignore-re = [
"\\bUku Taht\\b",
"Urfahr -> Linz",
"GOOGLE_CLIENT_SECRET=.+",
"\\bfo\\.wikipedia\\.org\\b",
'RecoveryCode.disambiguate\(".+"\) == ".+"',
]

[default.extend-words]
"referers" = "referers"

[default.extend-identifiers]
# Typos
"Github" = "GitHub"
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ All notable changes to this project will be documented in this file.
- Fix some links not opening correctly in new tab
- UI fix for more than one row of custom event properties plausible/analytics#1383
- UI fix for user menu and time picker overlapping plausible/analytics#1352
- Respect the `path` component of BASE_URL to allow subfolder installatons
- Respect the `path` component of BASE_URL to allow subfolder installations

### Removed
- Removes AppSignal monitoring package
Expand Down
6 changes: 3 additions & 3 deletions assets/js/dashboard/components/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React, { ReactNode } from 'react'
import { SortDirection } from '../hooks/use-order-by'
import { SortButton } from './sort-button'

export type ColumnConfiguraton<T extends Record<string, unknown>> = {
export type ColumnConfiguration<T extends Record<string, unknown>> = {
/** Unique column ID, used for sorting purposes and to get the value of the cell using rowItem[key] */
key: keyof T
/** Column title */
Expand Down Expand Up @@ -72,7 +72,7 @@ export const ItemRow = <T extends Record<string, string | number | ReactNode>>({
rowIndex: number
pageIndex?: number
item: T
columns: ColumnConfiguraton<T>[]
columns: ColumnConfiguration<T>[]
}) => {
return (
<tr className="text-sm dark:text-gray-200">
Expand All @@ -97,7 +97,7 @@ export const Table = <T extends Record<string, string | number | ReactNode>>({
data,
columns
}: {
columns: ColumnConfiguraton<T>[]
columns: ColumnConfiguration<T>[]
data: T[] | { pages: T[][] }
}) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion assets/js/dashboard/stats/graph/visitor-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default function VisitorGraph({ updateImportedDataInView }) {

return (
<FadeIn show={showingImported && unsupportedInterval} className="h-6 mr-1">
<span tooltip={"Inteval is too short to graph imported data"}>
<span tooltip={"Interval is too short to graph imported data"}>
<ExclamationCircleIcon className="w-6 h-6 text-gray-700 dark:text-gray-300" />
</span>
</FadeIn>
Expand Down
4 changes: 2 additions & 2 deletions assets/js/dashboard/stats/locations/map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ const highlightedCountryClass = classNames(

/**
* Used to color the countries
* @returns the svg elements represeting countries
* @returns the svg elements representing countries
*/
function colorInCountriesWithValues(
element: SVGSVGElement,
Expand Down Expand Up @@ -310,7 +310,7 @@ function setupProjetionPath() {

function parseWorldTopoJsonToGeoJsonFeatures(): Array<WorldJsonCountryData> {
const collection = topojson.feature(
// @ts-expect-error strings in worldJson not recongizable as the enum values declared in library
// @ts-expect-error strings in worldJson not recognizable as the enum values declared in library
worldJson,
worldJson.objects.countries
)
Expand Down
6 changes: 3 additions & 3 deletions assets/js/dashboard/stats/modals/breakdown-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from '../../hooks/use-order-by'
import { Metric } from '../reports/metrics'
import { BreakdownResultMeta, DashboardQuery } from '../../query'
import { ColumnConfiguraton } from '../../components/table'
import { ColumnConfiguration } from '../../components/table'
import { BreakdownTable } from './breakdown-table'
import { useSiteContext } from '../../site-context'

Expand Down Expand Up @@ -130,7 +130,7 @@ export default function BreakdownModal<TListItem extends { name: string }>({
afterFetchNextPage
})

const columns: ColumnConfiguraton<TListItem>[] = useMemo(
const columns: ColumnConfiguration<TListItem>[] = useMemo(
() => [
{
label: reportInfo.dimensionLabel,
Expand All @@ -147,7 +147,7 @@ export default function BreakdownModal<TListItem extends { name: string }>({
)
},
...metrics.map(
(m): ColumnConfiguraton<TListItem> => ({
(m): ColumnConfiguration<TListItem> => ({
label: m.renderLabel(query),
key: m.key,
width: m.width,
Expand Down
4 changes: 2 additions & 2 deletions assets/js/dashboard/stats/modals/breakdown-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import React, { ReactNode } from 'react'

import { SearchInput } from '../../components/search-input'
import { ColumnConfiguraton, Table } from '../../components/table'
import { ColumnConfiguration, Table } from '../../components/table'
import RocketIcon from './rocket-icon'
import { QueryStatus } from '@tanstack/react-query'

Expand All @@ -30,7 +30,7 @@ export const BreakdownTable = <TListItem extends { name: string }>({
hasNextPage: boolean
isFetchingNextPage: boolean
fetchNextPage: () => void
columns: ColumnConfiguraton<TListItem>[]
columns: ColumnConfiguration<TListItem>[]
data?: { pages: TListItem[][] }
status?: QueryStatus
error?: Error | null
Expand Down
6 changes: 3 additions & 3 deletions assets/js/dashboard/stats/modals/google-keywords.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from '../../util/number-formatter'
import { apiPath } from '../../util/url'
import { DashboardQuery } from '../../query'
import { ColumnConfiguraton } from '../../components/table'
import { ColumnConfiguration } from '../../components/table'
import { BreakdownTable } from './breakdown-table'

type GoogleKeywordItem = {
Expand Down Expand Up @@ -70,7 +70,7 @@ function GoogleKeywordsModal() {
initialPageParam: 0
})

const columns: ColumnConfiguraton<GoogleKeywordItem>[] = useMemo(
const columns: ColumnConfiguration<GoogleKeywordItem>[] = useMemo(
() => [
{
label: 'Search term',
Expand All @@ -79,7 +79,7 @@ function GoogleKeywordsModal() {
align: 'left'
},
...metrics.map(
(m): ColumnConfiguraton<GoogleKeywordItem> => ({
(m): ColumnConfiguration<GoogleKeywordItem> => ({
label: m.renderLabel(query),
key: m.key,
width: m.width,
Expand Down
2 changes: 1 addition & 1 deletion assets/js/dashboard/util/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export function parseSearchFragment(
return null
}
// tricky: the search string fragment is already decoded due to URLSearchParams intermediate (see tests),
// and these symbols are unparseable
// and these symbols are unparsable
const fragmentWithReEncodedSymbols = searchStringFragment
/* @ts-expect-error API supposedly not present in compilation target */
.replaceAll('=', encodeURIComponent('='))
Expand Down
2 changes: 1 addition & 1 deletion assets/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {
},
extend: {
colors: {
yellow: colors.amber, // We started usign `yellow` in v2 but it was renamed to `amber` in v3 https://tailwindcss.com/docs/upgrade-guide#removed-color-aliases
yellow: colors.amber, // We started using `yellow` in v2 but it was renamed to `amber` in v3 https://tailwindcss.com/docs/upgrade-guide#removed-color-aliases
gray: colors.slate,
'gray-950': 'rgb(13, 18, 30)',
'gray-850': 'rgb(26, 32, 44)',
Expand Down
4 changes: 2 additions & 2 deletions lib/plausible/auth/user_admin.ex
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
defmodule Plausible.Auth.UserAdmin do

Check failure on line 1 in lib/plausible/auth/user_admin.ex

View workflow job for this annotation

GitHub Actions / App code does not change at the same time

Code and migrations shouldn't be changed at the same time
use Plausible.Repo
use Plausible
require Plausible.Billing.Subscription.Status
alias Plausible.Billing.Subscription

def custom_index_query(_conn, _schema, query) do
subscripton_q = from(s in Plausible.Billing.Subscription, order_by: [desc: s.inserted_at])
from(r in query, preload: [subscription: ^subscripton_q])
subscription_q = from(s in Plausible.Billing.Subscription, order_by: [desc: s.inserted_at])
from(r in query, preload: [subscription: ^subscription_q])
end

def form_fields(_) do
Expand Down
4 changes: 2 additions & 2 deletions lib/plausible/cache/stats.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ defmodule Plausible.Cache.Stats do
{:ok, nil}
end

def handle_telemetry_event(@telemetry_hit, _measurments, %{cache: %{name: cache_name}}, _) do
def handle_telemetry_event(@telemetry_hit, _measurements, %{cache: %{name: cache_name}}, _) do
bump(cache_name, @hit)
end

def handle_telemetry_event(@telemetry_miss, _measurments, %{cache: %{name: cache_name}}, _) do
def handle_telemetry_event(@telemetry_miss, _measurements, %{cache: %{name: cache_name}}, _) do
bump(cache_name, @miss)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/plausible/data_migration/teams_consistency_check.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Plausible.DataMigration.TeamsConsitencyCheck do
defmodule Plausible.DataMigration.TeamsConsistencyCheck do
@moduledoc """
Verify consistency of teams.
"""
Expand Down
8 changes: 4 additions & 4 deletions lib/plausible/stats/imported/base.ex
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ defmodule Plausible.Stats.Imported.Base do
"time:hour" => "imported_visitors"
}

@queriable_time_dimensions ["time:month", "time:week", "time:day", "time:hour"]
@queryable_time_dimensions ["time:month", "time:week", "time:day", "time:hour"]

@imported_custom_props Imported.imported_custom_props()

Expand Down Expand Up @@ -92,10 +92,10 @@ defmodule Plausible.Stats.Imported.Base do
do_decide_custom_prop_table(query, dimension)
end

@queriable_custom_prop_dimensions ["event:goal", "event:name"] ++ @queriable_time_dimensions
@queryable_custom_prop_dimensions ["event:goal", "event:name"] ++ @queryable_time_dimensions
defp do_decide_custom_prop_table(%{dimensions: dimensions} = query) do
if dimensions == [] or
(length(dimensions) == 1 and hd(dimensions) in @queriable_custom_prop_dimensions) do
(length(dimensions) == 1 and hd(dimensions) in @queryable_custom_prop_dimensions) do
custom_prop_filters =
dimensions_used_in_filters(query.filters)
|> Enum.filter(&(&1 in @imported_custom_props))
Expand Down Expand Up @@ -169,7 +169,7 @@ defmodule Plausible.Stats.Imported.Base do
table_candidates =
dimensions_used_in_filters(query.filters)
|> Enum.concat(query.dimensions)
|> Enum.reject(&(&1 in @queriable_time_dimensions or &1 == "event:goal"))
|> Enum.reject(&(&1 in @queryable_time_dimensions or &1 == "event:goal"))
|> Enum.flat_map(fn
"visit:screen" -> ["visit:device"]
dimension -> [dimension]
Expand Down
6 changes: 3 additions & 3 deletions lib/plausible_web/controllers/site_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ defmodule PlausibleWeb.SiteController do
})
|> Repo.insert()

:ok = tolerate_unique_contraint_violation(result, "weekly_reports_site_id_index")
:ok = tolerate_unique_constraint_violation(result, "weekly_reports_site_id_index")

conn
|> put_flash(:success, "You will receive an email report every Monday going forward")
Expand Down Expand Up @@ -407,7 +407,7 @@ defmodule PlausibleWeb.SiteController do
})
|> Repo.insert()

:ok = tolerate_unique_contraint_violation(result, "monthly_reports_site_id_index")
:ok = tolerate_unique_constraint_violation(result, "monthly_reports_site_id_index")

conn
|> put_flash(:success, "You will receive an email report every month going forward")
Expand Down Expand Up @@ -741,7 +741,7 @@ defmodule PlausibleWeb.SiteController do
end
end

defp tolerate_unique_contraint_violation(result, name) do
defp tolerate_unique_constraint_violation(result, name) do
case result do
{:ok, _} ->
:ok
Expand Down
2 changes: 1 addition & 1 deletion lib/plausible_web/templates/auth/activate.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<.styled_link
method="delete"
href="/me?redirect=/register"
data-confim="Deleting your account cannot be reversed. Are you sure?"
data-confirm="Deleting your account cannot be reversed. Are you sure?"
>
Delete this account
</.styled_link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
Back
</a>
</span>
<span class="flex space-betwee rounded-md shadow-sm">
<span class="flex space-between rounded-md shadow-sm">
<.button_link
href={Routes.billing_path(@conn, :change_plan, @preview_info["plan_id"])}
method="post"
Expand Down
2 changes: 1 addition & 1 deletion lib/plausible_web/templates/layout/_header.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
</.dropdown_link>
<% else %>
<.dropdown_link new_tab href="https://github.com/plausible/analytics">
Github Repo
GitHub Repo
</.dropdown_link>
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion lib/plausible_web/views/layout_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ defmodule PlausibleWeb.LayoutView do
|> List.flatten()
end

def trial_notificaton(user) do
def trial_notification(user) do
case Plausible.Users.trial_days_left(user) do
days when days > 1 ->
"#{days} trial days left"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Plausible.Repo.Migrations.AddFingerprintSesssions do
defmodule Plausible.Repo.Migrations.AddFingerprintSessions do
use Ecto.Migration

def change do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule Plausible.Repo.Migrations.TrackAcceptTrafficUntilNotifcations do
defmodule Plausible.Repo.Migrations.TrackAcceptTrafficUntilNotifications do
use Ecto.Migration

def change do
Expand Down
2 changes: 1 addition & 1 deletion test/plausible/ingestion/event_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ defmodule Plausible.Ingestion.EventTest do
assert {:ok, %{buffered: [_], dropped: []}} = Event.build_and_buffer(request)
end

test "drops events for site with accept_trafic_until in the past" do
test "drops events for site with accept_traffic_until in the past" do
yesterday = Date.add(Date.utc_today(), -1)

site =
Expand Down
2 changes: 1 addition & 1 deletion test/plausible/release_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ defmodule Plausible.ReleaseTest do
* 20231204151831_backfill_last_bill_date_to_subscriptions
* 20231208125624_add_data_retention_in_years_to_plans
* 20231211092344_add_accept_traffic_until_to_sites
* 20231219083050_track_accept_traffic_until_notifcations
* 20231219083050_track_accept_traffic_until_notifications
* 20231220072829_add_accept_traffic_until_to_user
* 20231220101920_backfill_accept_traffic_until
* 20240103090304_upgrade_oban_jobs_to_v12
Expand Down
2 changes: 1 addition & 1 deletion test/plausible/shields/country_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ defmodule Plausible.Shields.CountryTest do
end

describe "remove_country_rule/2" do
test "is idempontent", %{site: site} do
test "is idempotent", %{site: site} do
{:ok, rule} = add_country_rule(site, %{"country_code" => "EE"})
assert remove_country_rule(site, rule.id) == :ok
refute Repo.get(Plausible.Shield.CountryRule, rule.id)
Expand Down
2 changes: 1 addition & 1 deletion test/plausible/shields/hostname_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ defmodule Plausible.Shields.HostnameTest do
end

describe "remove_hostname_rule/2" do
test "is idempontent", %{site: site} do
test "is idempotent", %{site: site} do
{:ok, rule} = add_hostname_rule(site, %{"hostname" => "test"})
assert remove_hostname_rule(site, rule.id) == :ok
refute Repo.get(Plausible.Shield.HostnameRule, rule.id)
Expand Down
Loading
Loading