clang-tidy v. -Weffc++
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 30/100
Piste de recherche
Commencez par la documentation de clang-tidy's readability-redundant-member-init et les discussions liées mapbox/cpp#37, wagyu#69 et wagyu#70 ; aucun fichier ni test du dépôt n'est identifié. Déterminez une approche approuvée pour -Weffc++, les recommandations de clang-tidy et la détection des membres non initialisés ; le travail est considéré comme terminé lorsqu'une recommandation et une configuration documentées sont disponibles.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Context
Recent versions of clang-tidy added readability-redundant-member-init: https://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-member-init.html
This is handy! When a class member has a default initializer it is redundent to initialize it in the member list.
But, because some types don't have default initializers, forgetting to initialize them in the member list (or using c++11 initialization in the class definition) can lead to serious trouble like mapbox/wagyu#69 - refs mapbox/wagyu#70.
So, this is the reason, at https://github.com/mapbox/cpp/issues/37#issuecomment-336200744, that we recommend using g++ and the -Weffc++ flag because it can catch this (note, clang++ plus -Weffc++ cannot):
-Weffc++ - useful when building with g++ (does not do much with clang++). With g++ it can catch uninitialized class members and prevent crashes like mapbox/wagyu#69 - refs mapbox/wagyu#70
Problem
-Weffc++will warn on all class members not explicitly initialized in the initializer listclang-tidywill automatically remove variables from the initializer list that have default constructors
So, the two will fight: causing each other warnings. For this reason I think we should likely:
- let clang-tidy win
- recommend no longer using g++ with
-Weffc++ - figure out what alternative way we can catch when members, without default initializers, are uninitialized (without needing to use
-Weffc++). Maybe anotherclang-tidycheck?
- Langage dominant
- Aucune donnée de langage
- Étoiles
- 110
- Forks
- 17
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de mapbox/cpp
-
glossary
Difficulté 1/5 Moins d'une heure Accessibilité débutants 68/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 25/100
-
Docs on ABIs Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 30/100
-
docs/learning-resources.md blank Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
-
Add namespace to glossary Ouverteglossary
Difficulté 2/5 1-3 heures Accessibilité débutants 58/100
Toutes les issues de mapbox/cpp
Issues similaires
-
kaliscan.com OuverteN: AdGuard for iOS P3: Medium T: Ads
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
AdguardTeam/AdguardFilters#242501 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
-
[BUG] createTool tools cannot be registered with Mastra when exactOptionalPropertyTypes is enabled Ouvertecustomer-eng status: needs triage
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
-
add-toolnames MCP Toolnames Toolnames checkup
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
rajbos/ai-engineering-fluency#2190 · 3 commentaires ·
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
gajus/eslint-plugin-jsdoc#1776 · 1 réaction ·