realm / realm/SwiftLint

Rule for enforcing no hardcoded string for identifiers.

Open
#1,377 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

rule-request
Dominant language
Swift
Stars
19.7k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
11

Description

I am using R.swift in my project which gives strong type for resources such as image names, segue identifiers, nib names, storyboard names. Is there a way to enforce that there is no hard coded string used in these cases in the code?

For e.g. I don't want people to use something like this: UIImage(named: "some-image").

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by reading SwiftLint's existing rule and test conventions, then investigate how it could distinguish resource identifiers from ordinary strings in UIImage(named:), segue, nib, and storyboard uses; done means the requested hardcoded-string cases are enforceable with clear diagnostics.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.