1use regex::Regex;
2
3pub struct GoPatterns {
4 external_patterns: Vec<Regex>,
5 cache_patterns: Vec<Regex>,
6 extensions: Vec<String>,
7}
8
9impl GoPatterns {
10 pub fn new() -> Self {
11 let external_patterns = vec![
12 Regex::new(r"go\.mod$").unwrap(),
14 Regex::new(r"go\.sum$").unwrap(),
15 Regex::new(r"go\.work$").unwrap(),
16 Regex::new(r"go\.work\.sum$").unwrap(),
17
18 Regex::new(r"vendor/").unwrap(),
20
21 Regex::new(r"\.exe$").unwrap(),
23 Regex::new(r"\.out$").unwrap(),
24
25 Regex::new(r"\.test$").unwrap(),
27 Regex::new(r"\.prof$").unwrap(),
28 Regex::new(r"\.mem$").unwrap(),
29 Regex::new(r"\.cpu$").unwrap(),
30
31 Regex::new(r"\.cover$").unwrap(),
33 Regex::new(r"coverage\.out$").unwrap(),
34 Regex::new(r"coverage\.html$").unwrap(),
35
36 Regex::new(r"bin/").unwrap(),
38 Regex::new(r"dist/").unwrap(),
39
40 Regex::new(r"\.pb\.go$").unwrap(),
42 Regex::new(r"\.pb\.gw\.go$").unwrap(),
43 Regex::new(r"bindata\.go$").unwrap(),
44 Regex::new(r"_gen\.go$").unwrap(),
45 Regex::new(r"_generated\.go$").unwrap(),
46
47 Regex::new(r"\.vscode/").unwrap(),
49 Regex::new(r"\.idea/").unwrap(),
50
51 Regex::new(r"\.DS_Store").unwrap(),
53 Regex::new(r"Thumbs\.db").unwrap(),
54
55 Regex::new(r"\.tmp$").unwrap(),
57 Regex::new(r"\.swp$").unwrap(),
58 Regex::new(r"\.swo$").unwrap(),
59 Regex::new(r"~$").unwrap(),
60
61 Regex::new(r"\.dockerignore$").unwrap(),
63
64 Regex::new(r"\.air\.toml$").unwrap(),
66 Regex::new(r"tmp/").unwrap(),
67
68 Regex::new(r"debug$").unwrap(),
70 Regex::new(r"debug\.exe$").unwrap(),
71
72 Regex::new(r"\.vscode/launch\.json$").unwrap(),
74
75 Regex::new(r"fyne-cross/").unwrap(),
77
78 Regex::new(r"wire_gen\.go$").unwrap(),
80
81 Regex::new(r"docs/").unwrap(),
83
84 Regex::new(r"mage_output_file\.go$").unwrap(),
86 ];
87
88 let cache_patterns = vec![
89 Regex::new(r"\.go/pkg/mod/").unwrap(),
91
92 Regex::new(r"\.go/pkg/sumdb/").unwrap(),
94
95 Regex::new(r"\.go/pkg/testcache/").unwrap(),
97
98 Regex::new(r"\.vscode/").unwrap(),
100 Regex::new(r"\.idea/").unwrap(),
101
102 Regex::new(r"tmp/").unwrap(),
104
105 Regex::new(r"bin/").unwrap(),
107 Regex::new(r"dist/").unwrap(),
108
109 Regex::new(r"\.cover$").unwrap(),
111 Regex::new(r"coverage\.").unwrap(),
112
113 Regex::new(r"\.prof$").unwrap(),
115 Regex::new(r"\.mem$").unwrap(),
116 Regex::new(r"\.cpu$").unwrap(),
117
118 Regex::new(r"\.tmp$").unwrap(),
120 Regex::new(r"\.temp$").unwrap(),
121
122 Regex::new(r"\.log$").unwrap(),
124
125 Regex::new(r"\.bak$").unwrap(),
127 Regex::new(r"\.backup$").unwrap(),
128
129 Regex::new(r"\.DS_Store").unwrap(),
131 Regex::new(r"Thumbs\.db").unwrap(),
132
133 Regex::new(r"\.swp$").unwrap(),
135 Regex::new(r"\.swo$").unwrap(),
136 Regex::new(r"~$").unwrap(),
137
138 Regex::new(r"\.idea/").unwrap(),
140
141 Regex::new(r"\.vscode/").unwrap(),
143
144 Regex::new(r"\.vim/").unwrap(),
146
147 Regex::new(r"\.emacs\.d/").unwrap(),
149
150 Regex::new(r"\.sublime-").unwrap(),
152
153 Regex::new(r"\.atom/").unwrap(),
155
156 Regex::new(r"\.brackets\.json").unwrap(),
158
159 Regex::new(r"\.nova/").unwrap(),
161
162 Regex::new(r"\.zed/").unwrap(),
164 ];
165
166 let extensions = vec![
167 "go".to_string(),
169
170 "mod".to_string(),
172 "sum".to_string(),
173 "work".to_string(),
174
175 "s".to_string(),
177
178 "tmpl".to_string(),
180 "tpl".to_string(),
181 "gotmpl".to_string(),
182
183 "gohtml".to_string(),
185
186 "gotxt".to_string(),
188
189 "proto".to_string(),
191
192 "yaml".to_string(),
194 "yml".to_string(),
195
196 "json".to_string(),
198
199 "toml".to_string(),
201
202 "md".to_string(),
204 ];
205
206 Self {
207 external_patterns,
208 cache_patterns,
209 extensions,
210 }
211 }
212
213 pub fn get_external_patterns(&self) -> &[Regex] {
214 &self.external_patterns
215 }
216
217 pub fn get_cache_patterns(&self) -> &[Regex] {
218 &self.cache_patterns
219 }
220
221 pub fn get_extensions(&self) -> &[String] {
222 &self.extensions
223 }
224
225 pub fn get_script_names() -> Vec<&'static str> {
226 vec![
227 "go.mod", "go.sum", "go.work", "go.work.sum",
229
230 "main.go", "cmd/main.go",
232
233 "Makefile", "makefile", "build.sh", "build.bat",
235 "build.ps1", "build.py", "build.go",
236
237 "magefile.go", "mage.go",
239
240 "Taskfile.yml", "Taskfile.yaml",
242
243 "Dockerfile", "docker-compose.yml", "docker-compose.yaml",
245 ".dockerignore", "Dockerfile.dev", "Dockerfile.prod",
246
247 ".air.toml", "air.conf",
249
250 "config.yaml", "config.yml", "config.json",
252 "config.toml", "settings.yaml", "app.yaml",
253
254 ".env", ".env.local", ".env.development", ".env.production",
256 ".env.test", ".env.example",
257
258 ".github/workflows/go.yml", ".github/workflows/test.yml",
260 ".github/workflows/build.yml", ".github/workflows/release.yml",
261 ".gitlab-ci.yml", "azure-pipelines.yml", "Jenkinsfile",
262 "bitbucket-pipelines.yml", "circle.yml", ".circleci/config.yml",
263 ".travis.yml", "appveyor.yml", "cloudbuild.yaml",
264
265 "go.test", "coverage.out", "coverage.html",
267 "benchmark.out", "profile.out",
268
269 ".golangci.yml", ".golangci.yaml", "golangci.yml",
271 ".gofmt", ".goimports", ".golint",
272
273 "README.md", "CHANGELOG.md", "CONTRIBUTING.md",
275 "LICENSE", "LICENSE.md", "COPYING",
276 "doc.go", "docs.go",
277
278 "swagger.yaml", "swagger.yml", "swagger.json",
280 "openapi.yaml", "openapi.yml", "openapi.json",
281 "api.yaml", "api.yml", "api.json",
282
283 "*.proto", "buf.yaml", "buf.yml", "buf.gen.yaml",
285 "buf.work.yaml", "buf.lock",
286
287 "grpc.proto", "service.proto",
289
290 "migrate.go", "schema.sql", "migrations/",
292
293 "k8s.yaml", "k8s.yml", "kubernetes.yaml",
295 "deployment.yaml", "service.yaml", "ingress.yaml",
296 "configmap.yaml", "secret.yaml",
297
298 "Chart.yaml", "values.yaml", "values.yml",
300 "requirements.yaml", "requirements.lock",
301
302 "main.tf", "variables.tf", "outputs.tf",
304 "terraform.tfvars", "terraform.tfstate",
305
306 "prometheus.yml", "grafana.json",
308 "jaeger.yaml", "zipkin.yaml",
309
310 "logrus.yaml", "zap.yaml", "zerolog.yaml",
312
313 "gin.go", "echo.go", "fiber.go", "chi.go",
315 "gorilla.go", "httprouter.go", "mux.go",
316
317 "gorm.go", "ent.go", "sqlx.go", "xorm.go",
319
320 "rabbitmq.go", "kafka.go", "nats.go", "redis.go",
322
323 "redis.go", "memcached.go", "cache.go",
325
326 "jwt.go", "oauth.go", "auth.go", "session.go",
328
329 "validator.go", "validate.go",
331
332 "json.go", "xml.go", "yaml.go", "toml.go",
334 "protobuf.go", "msgpack.go", "avro.go",
335
336 "client.go", "http.go", "rest.go", "graphql.go",
338
339 "utils.go", "helpers.go", "common.go", "shared.go",
341
342 "constants.go", "const.go", "vars.go",
344
345 "errors.go", "error.go", "exceptions.go",
347
348 "types.go", "models.go", "structs.go", "entities.go",
350
351 "interfaces.go", "interface.go", "contracts.go",
353
354 "handlers.go", "handler.go", "routes.go", "router.go",
356
357 "middleware.go", "middlewares.go",
359
360 "service.go", "services.go", "business.go",
362
363 "repository.go", "repositories.go", "repo.go",
365 "storage.go", "store.go", "dao.go",
366
367 "controller.go", "controllers.go", "ctrl.go",
369
370 "view.go", "views.go", "templates.go",
372
373 "model.go", "models.go", "entity.go", "entities.go",
375
376 "dto.go", "dtos.go", "request.go", "response.go",
378
379 "config.go", "configuration.go", "settings.go",
381
382 "db.go", "database.go", "connection.go", "conn.go",
384
385 "migration.go", "migrations.go", "migrate.go",
387
388 "seed.go", "seeds.go", "seeder.go", "seeders.go",
390
391 "*_test.go", "test.go", "tests.go", "testing.go",
393 "benchmark.go", "benchmarks.go", "example.go",
394
395 "mock.go", "mocks.go", "fake.go", "fakes.go",
397 "stub.go", "stubs.go",
398
399 "fixture.go", "fixtures.go", "testdata.go",
401
402 "factory.go", "factories.go", "builder.go", "builders.go",
404
405 "generator.go", "generators.go", "generate.go",
407
408 "parser.go", "parsers.go", "parse.go",
410
411 "validator.go", "validators.go", "validation.go",
413
414 "serializer.go", "serializers.go", "serialize.go",
416
417 "transformer.go", "transformers.go", "transform.go",
419
420 "converter.go", "converters.go", "convert.go",
422
423 "mapper.go", "mappers.go", "mapping.go",
425
426 "filter.go", "filters.go", "filtering.go",
428
429 "sorter.go", "sorters.go", "sorting.go",
431
432 "pagination.go", "paginate.go", "paging.go",
434
435 "search.go", "searcher.go", "searching.go",
437
438 "cache.go", "caching.go", "cached.go",
440
441 "queue.go", "queues.go", "job.go", "jobs.go",
443 "worker.go", "workers.go", "task.go", "tasks.go",
444
445 "scheduler.go", "schedule.go", "cron.go",
447
448 "event.go", "events.go", "eventbus.go",
450 "dispatcher.go", "listener.go", "listeners.go",
451
452 "notification.go", "notifications.go", "notify.go",
454
455 "email.go", "mail.go", "mailer.go", "smtp.go",
457
458 "sms.go", "text.go", "messaging.go",
460
461 "push.go", "fcm.go", "apns.go",
463
464 "file.go", "files.go", "filesystem.go", "storage.go",
466 "upload.go", "uploads.go", "download.go", "downloads.go",
467
468 "image.go", "images.go", "resize.go", "thumbnail.go",
470
471 "pdf.go", "pdfs.go", "report.go", "reports.go",
473
474 "excel.go", "xlsx.go", "csv.go", "spreadsheet.go",
476
477 "compress.go", "compression.go", "zip.go", "gzip.go",
479
480 "encrypt.go", "encryption.go", "crypto.go", "security.go",
482 "hash.go", "hashing.go", "jwt.go", "token.go", "tokens.go",
483
484 "log.go", "logger.go", "logging.go", "logs.go",
486
487 "metrics.go", "metric.go", "monitoring.go", "stats.go",
489
490 "health.go", "healthcheck.go", "ping.go", "status.go",
492
493 "ratelimit.go", "throttle.go", "limiter.go",
495
496 "circuit.go", "breaker.go", "hystrix.go",
498
499 "retry.go", "backoff.go", "exponential.go",
501
502 "timeout.go", "deadline.go", "context.go",
504
505 "shutdown.go", "graceful.go", "signal.go", "signals.go",
507
508 "profile.go", "profiling.go", "pprof.go",
510
511 "benchmark.go", "benchmarks.go", "bench.go",
513
514 "load.go", "loadtest.go", "stress.go", "stresstest.go",
516
517 "version.go", "versions.go", "build.go", "info.go",
519
520 "cli.go", "cmd.go", "command.go", "commands.go",
522 "flag.go", "flags.go", "args.go", "arguments.go",
523
524 "server.go", "servers.go", "app.go", "application.go",
526
527 "client.go", "clients.go", "api.go", "apis.go",
529
530 "proxy.go", "proxies.go", "gateway.go", "gateways.go",
532
533 "loadbalancer.go", "balancer.go", "lb.go",
535
536 "discovery.go", "registry.go", "consul.go", "etcd.go",
538
539 "consul.go", "etcd.go", "vault.go", "k8s.go",
541
542 "trace.go", "tracing.go", "jaeger.go", "zipkin.go",
544 "opentracing.go", "opentelemetry.go",
545
546 "deploy.go", "deployment.go", "k8s.go", "kubernetes.go",
548 "docker.go", "container.go", "containers.go",
549
550 "infrastructure.go", "infra.go", "terraform.go",
552 "cloudformation.go", "aws.go", "gcp.go", "azure.go",
553
554 "prometheus.go", "grafana.go", "datadog.go", "newrelic.go",
556
557 "alert.go", "alerts.go", "pagerduty.go", "slack.go",
559
560 "backup.go", "backups.go", "restore.go", "recovery.go",
562
563 "disaster.go", "recovery.go", "failover.go", "replication.go",
565
566 "performance.go", "perf.go", "optimization.go", "optimize.go",
568
569 "scale.go", "scaling.go", "autoscale.go", "horizontal.go",
571 "vertical.go", "cluster.go", "clusters.go",
572
573 "reliability.go", "reliable.go", "resilience.go", "fault.go",
575 "tolerance.go", "availability.go", "uptime.go",
576
577 "maintenance.go", "maintain.go", "cleanup.go", "clean.go",
579 "garbage.go", "gc.go", "housekeeping.go",
580
581 "migration.go", "migrations.go", "migrate.go", "upgrade.go",
583 "downgrade.go", "rollback.go", "revert.go",
584
585 "i18n.go", "l10n.go", "locale.go", "locales.go",
587 "translation.go", "translations.go", "language.go", "languages.go",
588
589 "a11y.go", "accessibility.go", "wcag.go", "aria.go",
591
592 "seo.go", "sitemap.go", "robots.go", "meta.go",
594
595 "analytics.go", "tracking.go", "ga.go", "gtm.go",
597
598 "ab.go", "abtest.go", "experiment.go", "experiments.go",
600 "feature.go", "features.go", "flag.go", "flags.go",
601
602 "social.go", "facebook.go", "twitter.go", "instagram.go",
604 "linkedin.go", "youtube.go", "tiktok.go",
605
606 "payment.go", "payments.go", "stripe.go", "paypal.go",
608 "square.go", "braintree.go", "checkout.go", "billing.go",
609
610 "subscription.go", "subscriptions.go", "plan.go", "plans.go",
612 "tier.go", "tiers.go", "pricing.go", "invoice.go", "invoices.go",
613
614 "inventory.go", "stock.go", "warehouse.go", "product.go", "products.go",
616 "catalog.go", "category.go", "categories.go",
617
618 "order.go", "orders.go", "cart.go", "carts.go",
620 "checkout.go", "fulfillment.go", "shipping.go",
621
622 "customer.go", "customers.go", "user.go", "users.go",
624 "account.go", "accounts.go", "profile.go", "profiles.go",
625
626 "content.go", "cms.go", "page.go", "pages.go",
628 "post.go", "posts.go", "article.go", "articles.go",
629 "blog.go", "news.go", "media.go",
630
631 "forum.go", "forums.go", "thread.go", "threads.go",
633 "topic.go", "topics.go", "comment.go", "comments.go",
634 "reply.go", "replies.go", "vote.go", "votes.go",
635
636 "chat.go", "message.go", "messages.go", "room.go", "rooms.go",
638 "channel.go", "channels.go", "websocket.go", "ws.go",
639
640 "realtime.go", "live.go", "streaming.go", "stream.go", "streams.go",
642 "sse.go", "websocket.go", "ws.go", "socket.go", "sockets.go",
643
644 "game.go", "games.go", "player.go", "players.go",
646 "match.go", "matches.go", "tournament.go", "tournaments.go",
647 "leaderboard.go", "score.go", "scores.go",
648
649 "iot.go", "device.go", "devices.go", "sensor.go", "sensors.go",
651 "actuator.go", "actuators.go", "mqtt.go", "coap.go",
652
653 "blockchain.go", "bitcoin.go", "ethereum.go", "smart.go",
655 "contract.go", "contracts.go", "wallet.go", "wallets.go",
656 "transaction.go", "transactions.go", "mining.go",
657
658 "ml.go", "ai.go", "neural.go", "network.go", "networks.go",
660 "model.go", "models.go", "training.go", "inference.go",
661 "prediction.go", "predictions.go", "classification.go",
662
663 "data.go", "dataset.go", "datasets.go", "analysis.go",
665 "visualization.go", "chart.go", "charts.go", "graph.go", "graphs.go",
666 "statistics.go", "stats.go", "math.go", "algorithm.go", "algorithms.go",
667
668 "bigdata.go", "hadoop.go", "spark.go", "kafka.go",
670 "elasticsearch.go", "solr.go", "lucene.go", "search.go",
671
672 "timeseries.go", "time.go", "series.go", "metric.go", "metrics.go",
674 "influxdb.go", "prometheus.go", "grafana.go",
675
676 "geo.go", "location.go", "locations.go", "map.go", "maps.go",
678 "gps.go", "coordinate.go", "coordinates.go", "distance.go",
679
680 "weather.go", "forecast.go", "climate.go", "temperature.go",
682 "humidity.go", "pressure.go", "wind.go", "rain.go",
683
684 "finance.go", "financial.go", "accounting.go", "budget.go", "budgets.go",
686 "expense.go", "expenses.go", "income.go", "revenue.go",
687 "profit.go", "loss.go", "tax.go", "taxes.go",
688
689 "hr.go", "human.go", "resources.go", "employee.go", "employees.go",
691 "payroll.go", "salary.go", "salaries.go", "benefit.go", "benefits.go",
692 "leave.go", "attendance.go", "performance.go", "review.go", "reviews.go",
693
694 "legal.go", "law.go", "compliance.go", "regulation.go", "regulations.go",
696 "policy.go", "policies.go", "contract.go", "contracts.go",
697 "agreement.go", "agreements.go", "license.go", "licenses.go",
698
699 "education.go", "school.go", "schools.go", "student.go", "students.go",
701 "teacher.go", "teachers.go", "course.go", "courses.go",
702 "lesson.go", "lessons.go", "exam.go", "exams.go",
703 "grade.go", "grades.go", "assignment.go", "assignments.go",
704
705 "health.go", "healthcare.go", "medical.go", "patient.go", "patients.go",
707 "doctor.go", "doctors.go", "appointment.go", "appointments.go",
708 "prescription.go", "prescriptions.go", "diagnosis.go", "treatment.go",
709
710 "travel.go", "trip.go", "trips.go", "booking.go", "bookings.go",
712 "hotel.go", "hotels.go", "flight.go", "flights.go",
713 "car.go", "cars.go", "rental.go", "rentals.go",
714
715 "food.go", "restaurant.go", "restaurants.go", "menu.go", "menus.go",
717 "recipe.go", "recipes.go", "ingredient.go", "ingredients.go",
718 "nutrition.go", "diet.go", "meal.go", "meals.go",
719
720 "sports.go", "sport.go", "team.go", "teams.go",
722 "athlete.go", "athletes.go", "competition.go", "competitions.go",
723 "season.go", "seasons.go", "league.go", "leagues.go",
724
725 "entertainment.go", "movie.go", "movies.go", "tv.go", "show.go", "shows.go",
727 "music.go", "song.go", "songs.go", "album.go", "albums.go",
728 "artist.go", "artists.go", "book.go", "books.go",
729
730 "news.go", "article.go", "articles.go", "story.go", "stories.go",
732 "headline.go", "headlines.go", "reporter.go", "reporters.go",
733 "editor.go", "editors.go", "publisher.go", "publishers.go",
734
735 "weather.go", "forecast.go", "climate.go", "temperature.go",
737 "humidity.go", "pressure.go", "wind.go", "rain.go", "snow.go",
738
739 "transport.go", "transportation.go", "vehicle.go", "vehicles.go",
741 "bus.go", "buses.go", "train.go", "trains.go",
742 "subway.go", "metro.go", "taxi.go", "uber.go", "lyft.go",
743
744 "realestate.go", "property.go", "properties.go", "house.go", "houses.go",
746 "apartment.go", "apartments.go", "rent.go", "rental.go", "rentals.go",
747 "sale.go", "sales.go", "mortgage.go", "mortgages.go",
748
749 "insurance.go", "policy.go", "policies.go", "claim.go", "claims.go",
751 "premium.go", "premiums.go", "coverage.go", "deductible.go",
752
753 "bank.go", "banking.go", "account.go", "accounts.go",
755 "transaction.go", "transactions.go", "transfer.go", "transfers.go",
756 "loan.go", "loans.go", "credit.go", "debit.go",
757
758 "investment.go", "investments.go", "portfolio.go", "portfolios.go",
760 "stock.go", "stocks.go", "bond.go", "bonds.go",
761 "fund.go", "funds.go", "etf.go", "etfs.go",
762
763 "crypto.go", "cryptocurrency.go", "bitcoin.go", "ethereum.go",
765 "blockchain.go", "wallet.go", "wallets.go", "exchange.go", "exchanges.go",
766 "trading.go", "trade.go", "trades.go", "market.go", "markets.go",
767
768 "retail.go", "store.go", "stores.go", "shop.go", "shops.go",
770 "product.go", "products.go", "inventory.go", "stock.go",
771 "sale.go", "sales.go", "discount.go", "discounts.go",
772
773 "manufacturing.go", "factory.go", "factories.go", "production.go",
775 "assembly.go", "quality.go", "control.go", "testing.go",
776 "inspection.go", "maintenance.go", "repair.go",
777
778 "logistics.go", "supply.go", "chain.go", "warehouse.go", "warehouses.go",
780 "distribution.go", "delivery.go", "deliveries.go", "shipping.go",
781 "tracking.go", "route.go", "routes.go",
782
783 "agriculture.go", "farm.go", "farms.go", "crop.go", "crops.go",
785 "livestock.go", "animal.go", "animals.go", "harvest.go",
786 "irrigation.go", "fertilizer.go", "pesticide.go",
787
788 "energy.go", "power.go", "electricity.go", "solar.go",
790 "wind.go", "nuclear.go", "coal.go", "oil.go", "gas.go",
791 "renewable.go", "grid.go", "utility.go", "utilities.go",
792
793 "environment.go", "environmental.go", "climate.go", "carbon.go",
795 "emission.go", "emissions.go", "pollution.go", "waste.go",
796 "recycling.go", "sustainability.go", "green.go", "eco.go",
797
798 "government.go", "gov.go", "public.go", "citizen.go", "citizens.go",
800 "voting.go", "election.go", "elections.go", "democracy.go",
801 "legislation.go", "law.go", "laws.go", "regulation.go", "regulations.go",
802
803 "nonprofit.go", "charity.go", "donation.go", "donations.go",
805 "volunteer.go", "volunteers.go", "fundraising.go", "grant.go", "grants.go",
806 "foundation.go", "foundations.go", "cause.go", "causes.go",
807 ]
808 }
809}