I could potentially see France attack Germany in a "Germany at war with someone else" scenario but I don't think it would be automatic. France would have to be pretty confident of victory to do it.
That tends to be my view- I would periodize likelihood based on different eras of French diplomatic priorities -
1870s - high likelihood of France getting involved if Germany is embroiled with Britain, Austria or Russia in a war. German overseas war with US, Japan, China is basically irrelevant to French calculation. Russo-German war very unlikely in this period.
Likewise Germany not inclined to attack France in event of overseas war, or eastern war.
1877-1879 - if Germany ends up in a war against Russia, in League with Austria, the Ottomans and Britain, France's decision is on the knife's edge. Having a Russian de facto ally is an opportunity most do not want to pass up, but if it's very risky if Britain is on the same side as Germany - thoughts?
Likewise Germany not inclined to attack France in event of overseas war, or eastern war.
1880-1884- France is more colonially focused and anti-British. France is likely to stay out of any German war with Britain, America, Spain, Portugal, China or Japan or anyplace in Latin America. Likely to stay out of any German-Austrian war, despite how disturbing that would be. Would probably favor joining Russia's side if Germany attacked her though, especially if Britain is uncommitted.
Likewise Germany not inclined to attack France in event of overseas war, or eastern war.
1885-1889 - France is likely to jump on Germany in case of Russo-German war, even if Britain is pro-Triple Alliance. In event of German fight with Britain, America, Japan, China, Spain, Portugal or Latin America overseas, France (and Russia) are likely to sit it out, and make unilateral gains in the non-European world.
Likewise Germany not inclined to attack France in event of overseas war, or eastern war.
1890-1903 - France will jump on Germany in case of Russo-German war, even if Britain is pro-Triple Alliance. In event of German fight with Britain, America, Japan, China, Spain, Portugal or Latin America overseas, France (and Russia) likely to sit it out, and make unilateral gains in the non-European world. But unlike previous period, Russo-German war is very unlikely in this period.
Germany not inclined to attack France in event of overseas war with a maritime power. But Germans will have to assume, and therefore possibly preempt, French action if a war with Russia occurs.
1904-1905 France will attack Germany if Germany attacks Russia or Britain. German fighting with America, China, Japan or Latin America will not bring France in against Germany, unless it first brings in Britain or Russia against Germany.
Germany will fight France also if it ends up in a fight with Russia or Britain. In the latter case, post Entente Cordiale, Germany would treat conquests in western Europe as either hostages or compensation for inevitable losses overseas. If Germany fights Japan, China, America or Latin America, it will not have to assume Russo-French hostility, unless any of the former measures bring down British participation.
1906-1913
If Germany ends up in a fight with Britain, Japan or America overseas, or against Russia, France will want and prepare for a continental war on Germany hoping for all these other countries as allies.
Germany will fight France also if it ends up in a fight with Russia or Britain. In the latter case, post Entente Cordiale, Germany would treat conquests in western Europe as either hostages or compensation for inevitable losses overseas. If Germany fights Japan, China, America or Latin America, it will not have to assume Russo-French hostility, unless any of the former measures bring down British participation.
------This estimate is based overwhelmingly on multipolar diplomatic relations at this time and respective imperial agendas. I know less about the year to year Franco-German military and naval balance through all these years.